Skip to content

Game data

The items data: typed tables, lookups by name, and the generated id enums.

gamedata.data

Static game data from the GGE items payload.

The client builds its combat maths from items_v{version}.json on the GGE CDN. That file is ~20 MB: GameData.require loads it on the first use of an API that needs it, and GameData.load (or EmpireClient.load_game_data) loads it up front. What is parsed is trimmed to the combat-relevant tables, the tables the id enums name and the rewards, and cached on disk per version, so the download happens once per game patch.

GameData.load is the only loader: troop counts and the id generator read the same process-wide copy, so one process downloads the items once.

Classes:

Name Description
GameData

The combat-relevant tables for one items version.

logger module-attribute

logger = logging.getLogger(__name__)

CACHE_FILENAME_TEMPLATE module-attribute

CACHE_FILENAME_TEMPLATE = 'items_v{version}.trimmed.json'

BERIMOND_INVASION_CAMP_TABLE module-attribute

BERIMOND_INVASION_CAMP_TABLE = 'factioninvasioncamps'

CAMP_TABLES module-attribute

CAMP_TABLES = ('nomadCamps', 'samuraiCamps', BERIMOND_INVASION_CAMP_TABLE, 'allianceInvasionCamps')

RAW_TABLES module-attribute

RAW_TABLES = ('bossdungeons', 'eventAutoScalingUnitPairings', 'eventAutoScalingToolPairings', 'mainquests')

Tables kept verbatim. The client parses no bossdungeons, pairing or mainquests rows, so their meaning is the server's.

R module-attribute

R = TypeVar('R', bound=EmpireModel)

L module-attribute

GameData pydantic-model

Bases: EmpireModel

The combat-relevant tables for one items version.

Load it explicitly:

data = GameData.load()
data.units[Unit.MEAD_RANGER_L6].range_attack
data.buildings[Building.KEEP_L1].might_value
data.general("Toril").general_id

The tables the id enums name are keyed by their enum: a row whose id the enum lacks (items newer than the enums) is keyed by its plain int, and as the enums are IntEnums, a plain id from a packet indexes every table.

The tables keyed by an id enum or an id type (RewardId, PackageId, TreasureMapNodeId, ...) are read-only Table mappings that validate a row the first time it is read, so loading costs no validation for them.

Fields:

model_config class-attribute

model_config: ConfigDict = ConfigDict(extra='ignore')

version pydantic-field

version: str

schema_fingerprint pydantic-field

schema_fingerprint: str = ''

Hash of the table fields, so a cache from older tables is not reused.

effect_caps pydantic-field

effect_caps: dict[int, EffectCapDef]

relic_effects pydantic-field

relic_effects: dict[int, RelicEffectDef]

equipment_sets pydantic-field

equipment_sets: dict[int, list[EquipmentSetDef]]

Each equipment set's threshold rows by set id, in the order listed.

fortifications pydantic-field

fortifications: dict[GameDataId['Building'], FortificationDef]

alliance_buffs pydantic-field

alliance_buffs: dict[int, AllianceBuffDef]

attack_slots pydantic-field

attack_slots: dict[int, AttackSlotDef]

tool_categories pydantic-field

tool_categories: dict[int, ToolCategoryDef]

default_commanders pydantic-field

default_commanders: dict[int, DefaultCommanderDef]

vip_levels pydantic-field

vip_levels: dict[int, VipLevelDef]

level_boosters pydantic-field

level_boosters: list[LevelBoosterDef]

The King's Market boosters bought in levels, a row per booster and level, in the order listed.

monument_levels pydantic-field

monument_levels: dict[int, MonumentLevelDef]

The monument levels by level; of two rows for one level, the last.

laboratory_levels pydantic-field

laboratory_levels: list[LaboratoryLevelDef]

The laboratory levels of every kingdom, in the order listed.

dungeons pydantic-field

dungeons: list[DungeonDefence]

camps pydantic-field

league_brackets pydantic-field

league_brackets: list[LeagueBracketDef]

raw_tables pydantic-field

raw_tables: dict[str, list[Any]]

units cached property

units: Table[GameDataId['Unit'], UnitStats]

Combat units by Unit: the units rows without slotTypes.

tools cached property

tools: Table[GameDataId['Tool'], ToolStats]

Siege and defence tools by Tool: the units rows with slotTypes.

effects cached property

effects: Table[GameDataId['Effect'], EffectDef]

Effects by Effect.

effect_types cached property

effect_types: Table[GameDataId['EffectType'], EffectTypeDef]

Effect types by EffectType.

construction_items cached property

construction_items: Table[GameDataId['ConstructionItem'], ConstructionItemDef]

Construction items by ConstructionItem.

global_effects cached property

global_effects: Table[GameDataId['GlobalEffect'], GlobalEffectDef]

Global effects by GlobalEffect.

general_skills cached property

general_skills: Table[GameDataId['GeneralSkill'], GeneralSkillDef]

General skill levels by GeneralSkill.

legendary_skills cached property

legendary_skills: Table[GameDataId['LegendarySkill'], LegendarySkillDef]

Legendary skill levels by LegendarySkill.

generals cached property

generals: Table[GameDataId['General'], GeneralDef]

Generals by General.

general_abilities cached property

general_abilities: Table[GameDataId['GeneralAbility'], GeneralAbilityDef]

General ability levels by GeneralAbility.

gem_colors cached property

gem_colors: Table[GameDataId['GemColor'], GemColorDef]

Gem colours by GemColor.

general_rarities cached property

general_rarities: Table[GameDataId['GeneralRarity'], GeneralRarityDef]

General rarities by GeneralRarity, with what unlocking and stars cost.

generals_hub_characters cached property

generals_hub_characters: Table[GameDataId['GeneralsHubCharacter'], GeneralsHubCharacterDef]

The generals hub's characters by GeneralsHubCharacter.

currencies cached property

currencies: Table[GameDataId['CurrencyId'], CurrencyDef]

Currencies by CurrencyId; coins and rubies are not in it.

raid_bosses cached property

raid_bosses: Table[GameDataId['RaidBoss'], RaidBossDef]

Alliance raid bosses by RaidBoss.

buildings cached property

buildings: Table[GameDataId['Building'], BuildingDef]

Buildings, towers, gates, moats and decorations by Building.

researches cached property

researches: Table[GameDataId['Research'], ResearchDef]

Research levels by Research, each with what it costs.

events cached property

events: Table[GameDataId['Event'], EventDef]

Events by Event.

loot_boxes cached property

loot_boxes: Table[GameDataId['LootBox'], LootBoxDef]

Loot boxes by LootBox.

loot_box_types cached property

loot_box_types: Table[GameDataId['LootBoxType'], LootBoxTypeDef]

Loot box types by LootBoxType.

equipment_groups cached property

equipment_groups: Table[GameDataId['EquipmentGroup'], EquipmentGroupDef]

Equipment item groups by EquipmentGroup.

difficulty_types cached property

difficulty_types: Table[GameDataId['DifficultyType'], DifficultyTypeDef]

Event difficulty types by DifficultyType.

quests cached property

quests: Table[GameDataId['QuestId'], QuestDef]

Quests by QuestId.

daily_quests cached property

daily_quests: Table[GameDataId['DailyQuestId'], DailyQuestDef]

Daily quests by DailyQuestId.

titles cached property

titles: Table[GameDataId['Title'], TitleDef]

Titles by Title.

gems cached property

gems: Table[GameDataId['Gem'], GemDef]

Gems by Gem.

sceat_skills cached property

sceat_skills: Table[GameDataId['SceatSkill'], SceatSkillDef]

Sceat skill levels by SceatSkill.

sceat_skill_trees cached property

sceat_skill_trees: Table[int, SceatSkillTreeDef]

Sceat skill trees by their SceatSkill.skill_tree_id, with the Hall of Legends tab each shows in.

feasts cached property

feasts: Table[GameDataId['Feast'], FeastDef]

Feasts by Feast: their price, recruitment speed bonus, duration and levels.

horses cached property

horses: Table[GameDataId['Horse'], HorseStats]

Travel boosters by Horse, the value movements send as HBW.

achievements cached property

achievements: Table[GameDataId['Achievement'], AchievementDef]

Achievement series steps by Achievement.

alliance_crest_colors cached property

alliance_crest_colors: Table[GameDataId['AllianceCrestColor'], AllianceCrestColorDef]

Alliance crest colours by AllianceCrestColor.

alliance_crest_layouts cached property

alliance_crest_layouts: Table[GameDataId['AllianceCrestLayout'], AllianceCrestLayoutDef]

Alliance crest layouts by AllianceCrestLayout.

construction_item_recipes cached property

The constructionItemRecipes rows, by the recipe id a blueprint research unlocks.

scaling_camps cached property

The eventAutoScalingCamps rows, by the scaling camp id a map row names.

coat_of_arms_symbols cached property

The crestsymbols rows, by the symbol id a coat of arms names.

packages cached property

The packages rows, by the package id a shop or a gift package names.

player_name_changes cached property

player_name_changes: Table[int, PlayerNameChangeDef]

The playerNameChanges rows, by the number of the player name change they price.

prebuilt_castles cached property

prebuilt_castles: Table[GameDataId['PrebuiltCastle'], PrebuiltCastleDef]

The castles and camps a kingdom, a season event's map or a special server starts with, by PrebuiltCastle.

Client: PrebuiltCastleData.parsePreBuiltCastles (bundle line 142274)

outer_realms_prebuilt_castles cached property

outer_realms_prebuilt_castles: Table[GameDataId['PrebuiltCastle'], SpecialServerPrebuiltCastleDef]

The Outer Realms' castle selection (tempServerPreBuiltCastles), by PrebuiltCastle.

horizon_prebuilt_castles cached property

horizon_prebuilt_castles: Table[GameDataId['PrebuiltCastle'], SpecialServerPrebuiltCastleDef]

Beyond the Horizon's castle selection (allianceBattleGroundPreBuiltCastles), by PrebuiltCastle.

storm_islands_prebuilt_castles cached property

storm_islands_prebuilt_castles: Table[GameDataId['PrebuiltCastle'], SpecialServerPrebuiltCastleDef]

The Storm Islands' castle selection (islandPreBuiltCastles), by PrebuiltCastle.

start_resources cached property

The goods a special server's prebuilt castle starts with, by the id its row names.

private_villages cached property

private_villages: Table[GameDataId['PrivateVillageType'], PrivateVillageDef]

Private resource villages by PrivateVillageType, one row per type, kingdom and level.

crafting_recipes cached property

The craftingRecipes rows, by the recipe id a crafting slot names.

crafting_queues cached property

The craftingQueues rows, by the queue id a crafting building's queue is sent with.

fusion_systems cached property

fusion_systems: Table[GameDataId['FusionForgeId'], FusionSystemDef]

The fusion forges' energy and fusion rules (fusionSystems), by FusionForgeId.

fusion_forges cached property

fusion_forges: Table[GameDataId['FusionForgeId'], FusionForgeDef]

The fusion forges' dust and minute skips (fusionForges), by FusionForgeId.

judgements cached property

judgements: Table[GameDataId['Judgement'], JudgementDef]

Citizen judgements by Judgement.

daimyo_castle_contracts cached property

daimyo_castle_contracts: Table[DaimyoContractId, DaimyoContractDef]

The daimyo castles' alliance contracts by id, in the items' order.

Client: SamuraiDaimyoDataXml.daimyoCastleAllianceContracts (bundle line 13914)

daimyo_township_contracts cached property

daimyo_township_contracts: Table[DaimyoContractId, DaimyoContractDef]

The daimyo townships' alliance contracts by id, in the items' order.

Client: SamuraiDaimyoDataXml.daimyoTownshipAllianceContracts (bundle line 13914)

treasure_maps cached property

treasure_maps: Table[GameDataId['TreasureMapId'], TreasureMapDef]

Treasure maps by TreasureMapId: the season events' maps and the treasure hunt's.

treasure_map_nodes cached property

The tmapnodes rows, by the node id a treasure map names.

part_pay_prices cached property

The partpayprices rows, by the id an obstacle, a treasure map node or a slum level is priced by.

Client: PartpaypriceVO.fillFromParamXml (bundle line 142257)

donation_items cached property

The donationItems rows, by the item id a donation names.

donation_settings cached property

The donationSettings rows, by the setting id a running donation event names.

training_programs cached property

The officers' school's training programs (officersSchoolEffects), by the program id gtp names.

event_difficulties cached property

The eventAutoScalingDifficulties rows, by the difficulty id an event is played at.

gachas cached property

The gachaEvents rows, the gacha events' levels, by the gacha id a pull names.

wheel_of_fortune_reward_sets cached property

The Wheel of Fortune's jackpot sets (luckywheelrewardsets), by the set id a wheel reply names.

wheel_of_fortune_win_classes cached property

The Wheel of Fortune's win classes (luckywheelclasses), by the win class a wheel reply names.

outer_realms_settings cached property

The Outer Realms' run settings (tempServerSettings), by setting id.

horizon_settings cached property

Beyond the Horizon's run settings (allianceBattleGroundSettings), by setting id.

alliance_tower_effects cached property

alliance_tower_effects: Table[GameDataId['AllianceTowerEffect'], AllianceTowerEffectDef]

Beyond the Horizon's alliance tower effects by AllianceTowerEffect.

oasis_settlements cached property

Beyond the Horizon's Oasis Settlements (tradingCamps), one row per level, by settlement id.

oasis_trades cached property

The trades Oasis Settlements offer (trades), by trade id.

citadel_levels cached property

The alliance Citadel's levels in Beyond the Horizon's Jade Desert (allianceCitadels), by row id.

alliance_invasion_camps cached property

The allianceInvasionCamps rows by camp id: the camp an aic push names while its event scales no difficulty; with a difficulty chosen, the push names a scaling_camps row.

rewards cached property

The rewards by id, each with the collectables it gives.

Client: CastleRewardData.parseXml (bundle line 142323)

equipment_effects cached property

equipment_effects: Table[GameDataId['EquipmentEffect'], EquipmentEffectDef]

The bonuses equipment can roll by EquipmentEffect, the id an item's bonus names.

Client: EquipmentXml.parseXml (bundle line 144227)

daimyo_castles cached property

daimyo_castles: Table[GameDataId['DaimyoCastle'], DaimyoCastleDef]

The Legion of the Daimyos' daimyo castles by DaimyoCastle, a row per rank and level.

Client: DaimyoCastleXmlData (bundle line 141378)

daimyo_townships cached property

daimyo_townships: Table[GameDataId['DaimyoTownship'], DaimyoTownshipDef]

The Legion of the Daimyos' townships by DaimyoTownship, a row per rank and level.

Client: DaimyoTownshipXmlData (bundle line 141400)

berimond_special_camps cached property

berimond_special_camps: Table[GameDataId['BerimondSpecialCamp'], BerimondSpecialCampDef]

The Battle for Berimond's watchtowers, capitals and resource village (specialcamps) by BerimondSpecialCamp.

Client: FactionEventVO.parseAdditionalXmlFromRoot (bundle line 7398)

league_type_events cached property

Each league's points thresholds and rewards per event and reward set (leaguetypeevents), by row id; league_type_event finds an event's.

leaderboard_rewards cached property

Each leaderboard rank band's rewards (leaderboardRewards), by row id; leaderboard_reward_bands finds an event's.

league_type_event

league_type_event(event_id: int, league_type_id: int, *, sub_type: int = 0, reward_set_id: int = 0) -> LeagueTypeEventDef | None

A league's rewards in an event: the first row of the event, sub type and league whose set is reward_set_id, any set when that is 0 or less; None for none, where the client raises.

Client: ALeagueTypeScoreEventVO.parseAdditionalXmlFromRoot (bundle lines 10268-10276)

leaderboard_reward_bands

leaderboard_reward_bands(event_id: int, reward_set_id: LeaderboardRewardSetId, league_type_id: int = -1) -> tuple[LeaderboardRewardDef, ...]

An event's leaderboard rank bands in a reward set, in table order; league_type_id=-1 takes every league's.

Client: CastleLeaderBoardRewardsData.getRewardListForDialogList (bundle line 112015)

reward_list

reward_list(reward_ids: Iterable[int], *, combine: bool = False) -> tuple[Collectable, ...]

What the rewards give, one after the other: a campaign's reward_ids, a title's reward_id.

An id with no reward (-1, or one the items lack) gives nothing.

Parameters:

Name Type Description Default
reward_ids Iterable[int]

The rewards, in order

required
combine bool

Add up the duplicates the client adds up, as some of its dialogs ask for

False

Client: CastleRewardData.getListByIdArray (bundle line 142344)

unit_asset_path

unit_asset_path(wod_id: int, *, index: AssetIndex | None = None) -> str

The unit's versioned bundle path.

Unknown IDs or missing assets raise KeyError. An omitted index loads lazily. Client: WodPicHelper.addUnitPic (bundle lines 2249–2251), BasicUnitVO.getShopIconURL (bundle line 19316).

tool_asset_path

tool_asset_path(wod_id: int, *, index: AssetIndex | None = None) -> str

The tool's versioned bundle path, with the client's ToolUnitVO fallback.

A missing ToolUnitVO asset resolves to Unknown_Unit_Tools; other row classes do not use that fallback. Unknown IDs or a missing final asset raise KeyError. An omitted index loads lazily. Client: ToolUnitVO.getVisualClassName (bundle lines 6537–6538), BasicUnitVO.getShopIconURL (bundle line 19316).

get_unit

get_unit(wod_id: int) -> UnitStats | None

get_tool

get_tool(wod_id: int) -> ToolStats | None

is_unit

is_unit(wod_id: int) -> bool

Whether the ID is a combat unit rather than a tool or boost item.

is_tool

is_tool(wod_id: int) -> bool

unit_sort_key

unit_sort_key(stack: WodAmount) -> tuple[bool, float]

A sort key putting units and tools in the client's order: sorted(army.courtyard(), key=data.unit_sort_key).

Soldiers come first by sort_order from the highest, then tools from the lowest (sorts_as_tool decides which is which). Stacks that tie keep their order, as Python's and the client's sorts are both stable.

An id with no unit or tool row sorts as a soldier without a sort_order, logged once per id; the client fails there instead (UnitInventoryList.addUnit throws, bundle line 21826).

Client: ClientConstSort.sortByUnitSortOrder (bundle line 3108), with _unitSortOrderNormal and _unitSortOrderInvert (bundle lines 3162-3163)

units_by_role

units_by_role(role: UnitRole) -> list[UnitStats]

Every unit of one role (SoldierUnitVO.role, bundle line 12590).

berimond_lane_towers

berimond_lane_towers(lane: BerimondLane) -> list[BerimondSpecialCampDef]

A Battle for Berimond lane's watchtowers, by id.

Client: FactionEventVO.getTowersByLane (bundle line 7473)

get_horse

get_horse(wod_id: int) -> HorseStats | None

A travel booster by its HBW value.

get_default_commander

get_default_commander(commander_id: int) -> DefaultCommanderDef | None

A default commander, i.e. one of the negative LID sentinels.

vip_level

vip_level(points: int) -> VipLevelDef | None

The VIP level points VIP points reach: the one whose range holds them, else the top one when points are above 0, else None.

Client: CastleVIPData.getVIPLevelInfoVOByPoints (bundle line 47531)

monument_level

monument_level(points: int) -> MonumentLevelDef | None

The level a monument with points upgrade points stands at: counting up from level 1, the last whose required points it holds, up to the first level missing from the table. None when it holds none of them.

Client: CastleMonumentData.getLevelInfoByPointsAchieved (split.js line 239099), which ignores the kingdom

laboratory_level

laboratory_level(points: int, kingdom: Kingdom) -> LaboratoryLevelDef | None

The level a laboratory in kingdom with points upgrade points stands at, counted as monument_level counts among that kingdom's levels.

Client: CastleLaboratoryData.getLevelInfoByPointsAchieved (split.js line 672219)

booster_levels

booster_levels(booster: BoosterId) -> dict[int, LevelBoosterDef]

A King's Market booster's rows by level; of two rows for one level, the last.

Client: CastlePremiumBoostData.parseXML (bundle line 81350)

returning_speed_percent

returning_speed_percent(level: int) -> int

The return speed booster's bonus in percent at level: 0 past the last level.

Raises:

Type Description
KeyError

the table has no row for a level up to its row count, where the client fails too.

Client: CastlePremiumBoostData.getBoostForReturningSpeedLevel (bundle line 81686)

caravan_overloader_percent

caravan_overloader_percent(level: int) -> int

The caravan overloader's bonus in percent at level.

Raises:

Type Description
KeyError

the table has no row for level, where the client fails too.

Client: CastlePremiumBoostData.getResourcesTransportablePerCarriage (bundle line 81705)

scaling_camp_level

scaling_camp_level(scaling_camp_id: ScalingCampId) -> int | None

The level an event's difficulty scaling gives a camp.

A map row that names a scaling camp overrides every other level source, which is how a chosen difficulty raises a camp for one player only.

berimond_invasion_camp

berimond_invasion_camp(level: int, faction_id: BerimondFaction | int) -> NpcCampDefence | None

A Berimond invasion camp's row: the one for its level and its owner's faction.

The table has a row per faction at each level, its count_victory being the camp's level; any faction but BerimondFaction.URSIDAE (blue) reads as red. A camp's wall, gate and cooldown come from this row.

Client: CastleFactionInvasionCampData.parseXML and getFactionInvasion (bundle lines 111903-111912), used by FactionInvasionCampMapObjectVO (bundle lines 76367-76380)

event_base_camp_level

event_base_camp_level(event_id: int, player_level: int, *, sub_type: int = 0) -> int | None

Where an invasion event's camps start for a player of this level.

Each event sorts players into level bands and gives every band its own victory range; a camp's base level is the bottom of that range, which is why the same camp is harder for a higher-level player.

league_type

league_type(league_type_id: int, event_id: int = -1, *, sub_type: int = 0) -> LeagueBracketDef | None

A league by the LID a highscore reply names, within its event.

The same id is a different level band in every event, and within an event in every sub type, so both are part of the key; event_id=-1 finds the rows of no event.

Client: AScoreEventVO.generateLeagueLevelsList (bundle line 14971)

resolve_relic_effect

resolve_relic_effect(relic_effect_id: int) -> EffectDef | None

The plain effect a relic bonus id points at.

Relic bonuses index the relic effect table, which then names a normal effect; the two id spaces overlap and disagree.

effect_type_name

effect_type_name(effect_id: int) -> str

Resolve an effect ID to its effect type's name.

dungeon_defense

dungeon_defense(victories: int, kingdom_id: Kingdom | int = GREEN) -> DungeonDefence | None

The robber baron camp's defense for a victory count in a kingdom.

A count past the kingdom's highest row reads that row; one below its lowest, or a kingdom with no rows, finds None, where the client gets undefined. A treasure map dungeon is looked up by its node's own countVictories and its map's kID, as TreasureDungeonMapObjectVO.skipCooldownCostC2 does (bundle line 22007).

Client: CastleDungeonData.getDungeon (bundle lines 111765-111766)

Parameters:

Name Type Description Default
victories int

The robber baron camp's victory count, from MapAreaItem.victory_count

required
kingdom_id Kingdom | int

The robber baron camp's kingdom, or a treasure map's kID

GREEN

raw

raw(table: str) -> list[Any]

An unmodeled table, exactly as the payload had it.

general

general(name: str) -> GeneralDef | None

A general by its generalName, e.g. "Toril".

general_ability

general_ability(name: str, level: int) -> GeneralAbilityDef | None

A general's ability at one level, e.g. ("PowerSurge", 1).

general_skill

general_skill(general_id: int, name: str, level: int) -> GeneralSkillDef | None

One level of a general's skill; the general's id comes from general.

Skill names repeat across generals, so the general is part of the key.

legendary_skill

legendary_skill(tree_id: int, group_id: int, level: int) -> LegendarySkillDef | None

A Legendary skill by its tree, group and level.

Its effectType is no key: the same effect sits in more than one tree.

currency

currency(json_key: str) -> CurrencyDef | None

A currency by its JSONKey, e.g. "KT" for khan tablets.

C1 and C2 (coins and rubies) are not in this table.

Client: CurrencyData.getXmlCurrencyByKey (bundle line 141194)

effect_type

effect_type(name: str) -> EffectTypeDef | None

An effect type by name, e.g. "fameDefenseBonus".

raid_boss

raid_boss(name: str) -> RaidBossDef | None

An alliance raid boss by name, e.g. "Necromancer".

global_effect

global_effect(name: str) -> GlobalEffectDef | None

A global effect by name.

Names are not quite unique: "SpeedBoost" is two effects of different strength, and asking for it raises with both ids.

unit

unit(unit_type: str, level: int | None = None) -> UnitStats | None

A unit by its type and, optionally, level.

Units have no unique name. A type repeats across levels, and event variants of one unit share its type, often with no level to tell them apart (Ogermace is both 68 and 7), so a lookup that still matches several units raises rather than picking one. A row without a level has level -1, as the client reads it, so level=-1 finds those and level=0 only a row whose level is 0.

tool

tool(tool_type: str, level: int | None = None) -> ToolStats | None

A tool by its type and, optionally, level; see unit for why it can be ambiguous.

Event copies of a tool share its type (EliteComboRam is both 113 and 564).

parse classmethod

parse(version: str, items_data: dict[str, Any]) -> 'GameData'

Trim a full items payload down to the combat-relevant tables.

load classmethod

load(*, refresh: bool = False, cache_dir: str | Path | None = None) -> 'GameData'

The game data for the current items version, downloaded at most once per version.

The version file is checked on every call, so a game patch invalidates the cache on its own. The data is kept for the process and every caller gets the same instance while the version holds: it is shared, so treat it as read-only and never change its tables or rows. Without a kept copy for the version, the disk cache is tried, and only a miss downloads the full payload. Concurrent loads, in threads or processes sharing cache_dir, make one download between them.

When the CDN cannot be reached, the data already kept is returned (with a warning), even if a newer version could not be fetched. Only a load with nothing kept, or with refresh=True, raises. After a failed fetch the CDN is not asked again for five minutes.

Parameters:

Name Type Description Default
refresh bool

Ignore the kept and cached copies and any failure backoff, and re-download

False
cache_dir str | Path | None

Where to keep trimmed data (default: XDG cache dir). It is read and written only when the kept copy is not current, so a call that finds it current returns it whatever cache_dir it was loaded with.

None

Raises:

Type Description
NetworkError

Nothing is kept (or refresh is set) and the CDN could not be reached, now or less than five minutes ago

loaded classmethod

loaded() -> 'GameData | None'

The data the last load in this process gave, or None; never touches the network.

It is the instance load hands every caller, so treat it as read-only.

require classmethod

require() -> 'GameData'

The data loaded in this process, loading it on first use: what the APIs that need game data read.

loaded when there is data, without touching the network; otherwise load, which reads the disk cache when present and downloads only on a miss. Threads that call it at once share one download. After a failed load it raises without another request for five minutes, as load does.

Raises:

Type Description
GameDataNotLoadedError

Nothing is loaded and the game data cannot be loaded

gamedata.models

Typed rows from the GGE items payload.

Values arrive as strings, so every numeric field relies on pydantic coercion. Tables whose meaning is not yet established are kept raw by GameData instead of being modeled here on a guess.

Classes:

Name Description
UnitStats

A combat unit.

ToolStats

A siege or defense tool.

EffectDef

An effect, e.g. relicOffensiveMeleeBonus.

EffectTypeDef

An effect type, e.g. fameDefenseBonus.

EffectCapDef

The ceiling a group of effects stacks up to.

EffectValue

One bonus of an items row: an effect and its value, an effectID&value entry of the effects column.

EquipmentEffectValue

One bonus of an equipment set or default commander: an equipment effect id and its value.

EffectSpecRow

Base for tables whose bonuses are an effects column of effectID&value entries, comma separated.

EquipmentEffectSpecRow

Base for tables whose effects column names equipment effect ids: equipment sets and default commanders.

ConstructionItemDef

A construction item - the decorations placed on castle buildings.

AllianceBuffDef

One alliance buff level and its alliance treasury cost.

GlobalEffectDef

A global (event) effect, active for everyone while its event runs.

SceatSkillDef

One level of a sceat skill, from the Hall of Legends trees.

SceatSkillTreeDef

A Hall of Legends sceat skill tree and the tab it shows in.

GeneralSkillDef

One level of a general's skill.

FortificationDef

A wall, gate or moat building and the protection it gives.

RelicEffectDef

A relic effect, which is a different id space from a plain effect.

EquipmentEffectDef

A bonus an equipment item can roll.

GemDef

A gem that can be slotted into an equipment item.

EquipmentSetDef

One threshold of an equipment set: the bonuses worn items of the set grant from needed_items on.

LegendarySkillDef

One level of a Legendary skill, e.g. gateReduction.

AttackSlotDef

An attack-screen slot and what unlocking it costs.

ToolCategoryDef

A tool category, e.g. basic.

HorseStats

A travel booster - the value behind the HBW field on movements.

DefaultCommanderDef

A default commander, one of the negative commander ids.

GeneralAbilityDef

One level of a general's ability, the value set_abilities sends per slot.

CurrencyDef

A currency; json_key is the key the server uses for it in currency lists.

RaidBossDef

An alliance raid boss.

GeneralDef

A general, the hero assigned to a commander.

DungeonDefence

What defends a robber baron camp, or a treasure map dungeon, at a given victory count.

NpcCampDefence

An event camp's defense, shared shape across the camp tables.

DaimyoCastleDef

A daimyoCastles row, by the id a daimyo castle's map row names.

DaimyoTownshipDef

A daimyoTownships row, by the id a township's map row names.

LeagueBracketDef

A league: the level band an event sorts a player into, a row of leaguetypes.

Functions:

Name Description
parse_stacks

Parse the wodID+count#wodID+count encoding used for camp defenses.

parse_ids

Parse a comma-separated ID list.

Attributes:

Name Type Description
FIGHT_TYPE_OFFENSIVE
FIGHT_TYPE_DEFENSIVE
ECONOMY_SORT_CATEGORY

FIGHT_TYPE_OFFENSIVE module-attribute

FIGHT_TYPE_OFFENSIVE = 0

FIGHT_TYPE_DEFENSIVE module-attribute

FIGHT_TYPE_DEFENSIVE = 1

ECONOMY_SORT_CATEGORY module-attribute

ECONOMY_SORT_CATEGORY = 7

READING_CACHE module-attribute

READING_CACHE: ContextVar[bool] = ContextVar('reading_game_data_cache', default=False)

True while GameData reads its own cache, whose ints are already parsed values.

UnitStats pydantic-model

Bases: _UnitRow

A combat unit.

GameData.parse takes the units rows without slotTypes as units. The client picks a row's class from name and group instead (CastleWodData.getClassName, bundle line 2057): Barracks, Eventunit, Keep, Kingdomunit and QuickAttack rows are SoldierUnitVOs, while an Unknown row is a bare BasicUnitVO that reads no soldier columns.

Client: SoldierUnitVO.parseXmlNode (bundle line 12531), after BasicUnitVO.parseXmlNode (bundle line 19211)

Fields:

Validators:

wod_id pydantic-field

wod_id: GameDataId['Unit']

Wire key wodID

The unit; required

unit_type pydantic-field

unit_type: str = ''

Wire key type

Unit type, e.g. MeadRanger; shared across levels

role pydantic-field

role: GameDataKey[UnitRole] = ''

Melee or ranged; empty for none

melee_attack pydantic-field

melee_attack: int = 0

Wire key meleeAttack

Base melee attack

range_attack pydantic-field

range_attack: int = 0

Wire key rangeAttack

Base ranged attack

melee_defense pydantic-field

melee_defense: int = 0

Wire key meleeDefence

Base defence against melee

range_defense pydantic-field

range_defense: int = 0

Wire key rangeDefence

Base defence against ranged

loot_value pydantic-field

loot_value: int = 0

Wire key lootValue

Loot one unit carries

mead_supply pydantic-field

mead_supply: int = 0

Wire key meadSupply

Mead upkeep

beef_supply pydantic-field

beef_supply: int = 0

Wire key beefSupply

Beef upkeep

food_supply pydantic-field

food_supply: int = 0

Wire key foodSupply

Food upkeep, before the global food-consumption effect

healing_cost_coins pydantic-field

healing_cost_coins: int = 0

Wire key healingCostC1

Coin cost to heal one, before cost effects

healing_cost_rubies pydantic-field

healing_cost_rubies: int = 0

Wire key healingCostC2

Ruby cost to heal one

hybrid pydantic-field

hybrid: bool = False

Fits either flank

asset_name property

asset_name: str

The class name the client draws it by, e.g. Barracks_Unit_Speerman.

<name>_<group>, then _<type> when the type is not empty: AVisualVO.getVisualClassName (bundle line 17795), which WodPicHelper.addUnitPic (bundle line 2248) loads. The full asset path comes from the client's versioned item map (ItemVersions, in ggs.dll); GameData.unit_asset_path resolves that map lazily.

name_text_id property

name_text_id: str

The text id of its name, <type>_name in lower case: BasicUnitVO.getNameString (bundle line 19219).

is_melee property

is_melee: bool

is_ranged property

is_ranged: bool

is_allround property

is_allround: bool

A hybrid unit, which fits either flank (BasicUnitVO.isAllround, bundle line 19318).

attack_value property

attack_value: int

Raw offence, before any commander or equipment effects.

The client adds a global-event bonus on top of this (EFFECT_TYPE_ATTACK_BONUS_UNIT), which is not modeled yet.

is_offensive property

is_offensive: bool

Whether the game treats this unit as an attacker (BasicUnitVO.isOffensive, bundle line 19316).

This is the fightType column, not "has an attack value": a defensive unit such as a halberdier carries a small attack value but is never an auto-fill candidate.

ToolStats pydantic-model

Bases: _UnitRow

A siege or defense tool.

GameData.parse takes the units rows with slotTypes as tools; the client's ToolUnitVO rows are those named Workshop, Dworkshop, Elitetool, Eventtool and SceatTools. effects name plain effect ids; resolve them through effects.

The raw_*_bonus columns are percentages. The client scales them by 0.01 as it parses, so the fractions are the properties of the same name without raw_: scaling in a validator would scale again on every cache round trip.

Client: ToolUnitVO.parseXmlNode (bundle line 6538), after BasicUnitVO.parseXmlNode (bundle line 19211); ToolUnitVO.parseEffects (bundle line 6644); EventtoolUnitVO.parseXmlNode (bundle line 118914)

Fields:

Validators:

wod_id pydantic-field

wod_id: GameDataId['Tool']

Wire key wodID

The tool; required

tool_type pydantic-field

tool_type: str = ''

Wire key type

Tool type, e.g. Ladder; shared across levels, keys the per-wave limit

category pydantic-field

category: GameDataKey[ToolSide] = '0'

Wire key typ

Attack or defence; "0" when the row has none

slot_types pydantic-field

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

Wire key slotTypes

Attack-screen slot types it fits

raw_allowed_to_attack pydantic-field

raw_allowed_to_attack: str = ''

Wire key allowedToAttack

space+areaType pairs joined by #; see allowed_targets

tool_category pydantic-field

tool_category: GameDataKey[ToolCategory] = ''

Wire key toolCategory

Tool category, e.g. basic; empty for none

used_for_events pydantic-field

used_for_events: tuple[GameDataId['Event'], ...] = ()

Wire key clientUsageEventID

Events an event tool is used in; empty for none

amount_per_wave pydantic-field

amount_per_wave: int = -1

Wire key amountPerWave

The row's per-wave limit; -1 when absent. per_wave_limit is the limit that applies

can_attack_npc pydantic-field

can_attack_npc: bool = True

Wire key canBeUsedToAttackNPC

Usable against an NPC target

effects pydantic-field

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

The tool's own effects

raw_wall_bonus pydantic-field

raw_wall_bonus: int = 0

Wire key wallBonus

Wall protection cancelled, in percent

raw_gate_bonus pydantic-field

raw_gate_bonus: int = 0

Wire key gateBonus

Gate protection cancelled, in percent

raw_moat_bonus pydantic-field

raw_moat_bonus: int = 0

Wire key moatBonus

Moat protection cancelled, in percent

raw_def_range_bonus pydantic-field

raw_def_range_bonus: int = 0

Wire key defRangeBonus

Defender ranged strength cancelled, in percent

raw_def_melee_bonus pydantic-field

raw_def_melee_bonus: int = 0

Wire key defMeleeBonus

Defender melee strength cancelled, in percent

raw_off_range_bonus pydantic-field

raw_off_range_bonus: int = 0

Wire key offRangeBonus

Ranged attack added, in percent

raw_off_melee_bonus pydantic-field

raw_off_melee_bonus: int = 0

Wire key offMeleeBonus

Melee attack added, in percent

asset_name property

asset_name: str

The class name the client draws it by, e.g. Workshop_Unit_Ram.

<name>_<group>, then _<type> when the type is not empty: AVisualVO.getVisualClassName (bundle line 17795), which WodPicHelper.addUnitPic (bundle line 2248) loads. ToolUnitVO.getVisualClassName (bundle line 6539) draws Unknown_Unit_Tools instead when that name has no versioned asset; that check, and the full asset path, need the client's versioned item map (ItemVersions, in ggs.dll). GameData.tool_asset_path resolves that map and applies the fallback; this property is the original name.

name_text_id property

name_text_id: str

The text id of its name, <type>_name in lower case: BasicUnitVO.getNameString (bundle line 19219).

wall_bonus property

wall_bonus: float

Wall protection this tool cancels, as a fraction.

gate_bonus property

gate_bonus: float

Gate protection this tool cancels, as a fraction.

moat_bonus property

moat_bonus: float

Moat protection this tool cancels, as a fraction.

def_range_bonus property

def_range_bonus: float

Defender ranged strength this tool cancels, as a fraction.

def_melee_bonus property

def_melee_bonus: float

Defender melee strength this tool cancels, as a fraction.

off_range_bonus property

off_range_bonus: float

Ranged attack this tool adds, as a fraction.

off_melee_bonus property

off_melee_bonus: float

Melee attack this tool adds, as a fraction.

allowed_targets property

allowed_targets: tuple[tuple[int | None, int | None], ...]

(space_id, area_type) pairs this tool may attack.

An empty list means no restriction, and -1 in either position means "any". A position with no leading integer is None, the client's NaN: that pair matches no target but still makes the list a restriction.

Client: BasicUnitVO.parseSpaceIdAreaTypeValues (bundle line 19214)

per_wave_limit property

per_wave_limit: int

How many of this tool one wave may carry; 0 or less means no limit.

An offence support tool - one that fits slot type 10 - is always limited to one, whatever the column says.

Client: ToolUnitVO.amountPerWave (bundle line 6658)

is_attack_tool property

is_attack_tool: bool

typ is ClientConstCastle.ATTACK_TOOL.

is_defense_tool property

is_defense_tool: bool

typ is ClientConstCastle.DEFENSE_TOOL.

is_allowed_by_attack_target

is_allowed_by_attack_target(space_id: int | None, area_type: int | None) -> bool

Whether the tool may attack this target; no list means allowed anywhere.

None for the space or area type means it is unknown and matches any pair; a pair holding the client's NaN matches nothing.

Client: BasicUnitVO.checkIfTargetIsInArray (bundle line 19324)

fits_slot

fits_slot(slot_type: int) -> bool

Whether this tool may go in the given slot type (ToolUnitVO.isToolForSlotType, bundle line 6541).

EffectDef pydantic-model

Bases: _Row

An effect, e.g. relicOffensiveMeleeBonus.

An effect names which bonus an item grants; the effect type says what it modifies, and the cap says what it stacks with.

Fields:

Validators:

effect_id pydantic-field

effect_id: GameDataId['Effect']

Wire key effectID

The effect

name pydantic-field

name: str = ''

effect_type_id pydantic-field

effect_type_id: GameDataId['EffectType'] = 0

Wire key effectTypeID

The effect type it modifies

cap_id pydantic-field

cap_id: int | None = None

Wire key capID

area_type_ids pydantic-field

area_type_ids: tuple[GameDataId[MapItemType], ...] = ()

Wire key areaTypeID

Area types it applies to; empty for every area

is_pvp_fight pydantic-field

is_pvp_fight: bool = False

Wire key isPvPFight

is_pve_fight pydantic-field

is_pve_fight: bool = False

Wire key isPvEFight

space_ids pydantic-field

space_ids: tuple[GameDataId[Kingdom], ...] = ()

Wire key spaceIDs

Kingdoms it applies in, as the client compares them with the area's spaceId; empty for every one

player_relation pydantic-field

player_relation: GameDataKey[PlayerRelation] = ''

Wire key playerRelation

The relationship to the target it needs; empty for any

raid_boss_ids pydantic-field

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

Wire key raidBossID

Raid bosses it is tied to; empty for none in particular

applies_to_area

applies_to_area(area_type: int | None) -> bool

Whether the effect counts against a target of this area type; None or below 0 is every area.

Client: BonusVO.matchesConditions (bundle line 5708) checks the area type only above -1

applies_to_space

applies_to_space(space_id: int | None) -> bool

Whether the effect counts in this castle space; None or below 0 is every space.

Client: BonusVO.matchesConditions (bundle line 5708) checks the space only above -1

applies_to_relation

applies_to_relation(relation: PlayerRelation | str | None) -> bool

Whether the effect counts given the relationship to the target.

An unconditioned effect always counts; passing None leaves conditioned ones in, since the relationship is unknown rather than absent.

is_for_raid_boss

is_for_raid_boss(raid_boss_id: int) -> bool

Whether the effect counts against this raid boss.

Client: EffectVO.isForRaidBoss (bundle line 41705).

applies_to_raid_boss

applies_to_raid_boss(raid_boss_id: int | None) -> bool

Whether the effect counts against this raid boss; None keeps every effect.

Client: EffectVO.isForRaidBoss (bundle line 41705) once a boss is known.

applies_to_fight

applies_to_fight(*, player_target: bool | None) -> bool

Whether the effect counts in this kind of fight.

Some effects are flagged for player fights only and some for NPC fights only; an unflagged effect counts in both.

EffectTypeDef pydantic-model

Bases: _Row

An effect type, e.g. fameDefenseBonus.

Fields:

effect_type_id pydantic-field

effect_type_id: GameDataId['EffectType']

Wire key effectTypeID

The effect type

name pydantic-field

name: str = ''

sort_category pydantic-field

sort_category: int | None = None

Wire key sortCategory

combat_type pydantic-field

combat_type: int | None = None

Wire key combatType

is_economy property

is_economy: bool

Economy effects, which every combat filter strategy drops.

Category 7 in the client's own grouping.

EffectCapDef pydantic-model

Bases: _Row

The ceiling a group of effects stacks up to.

A row without maxTotalBonus - cap 99 among them - is uncapped, which is why the field is optional rather than defaulting to zero.

Fields:

cap_id pydantic-field

cap_id: int

Wire key capID

max_total_bonus pydantic-field

max_total_bonus: float | None = None

Wire key maxTotalBonus

is_uncapped property

is_uncapped: bool

EffectValue pydantic-model

Bases: _EffectEntry

One bonus of an items row: an effect and its value, an effectID&value entry of the effects column.

The client reads the value with the class its effect's type names (BonusVO.parseFromValueString, bundle line 5706): one number (EffectValueSimple, bundle line 17751), wodID+value pairs joined by # (EffectValueWodID and EffectValueMap, bundle lines 17699 and 31617) or ids joined by # (EffectValueIdList, bundle line 62242). Which one applies needs the effect types table, so values keeps the numbers in that structure: 10 is ((10,),), 686+30#687+30 is ((686, 30), (687, 30)) and 1#2 is ((1,), (2,)).

The numbers stay plain even where they are ids: the key of a wodID+value pair is a wod id (EffectValueWodID reads Number of it), and an id list names whatever its effect type unlocks, so which table they index depends on the effect type, not on the column.

Fields:

id_field class-attribute

id_field: str = 'effect_id'

effect_id pydantic-field

effect_id: GameDataId['Effect']

The effect

EquipmentEffectValue pydantic-model

Bases: _EffectEntry

One bonus of an equipment set or default commander: an equipment effect id and its value.

The id indexes GameData.equipment_effects, not the effects table.

Client: EquipmentBonusVO.parseEquipmentFromValueString (bundle line 20940)

Fields:

id_field class-attribute

id_field: str = 'equipment_effect_id'

equipment_effect_id pydantic-field

equipment_effect_id: GameDataId['EquipmentEffect']

The equipment effect

EffectSpecRow pydantic-model

Bases: _Row

Base for tables whose bonuses are an effects column of effectID&value entries, comma separated.

Construction items, alliance buffs, global effects, sceat skills, general skills and gems name plain effect ids this way, each parsed with BonusVO.parseFromValueString (bundle line 5706): construction items in ConstructionItemVO.parseBoni (bundle line 47721), alliance buffs in AllianceBuffVO.fillFromParamXml (bundle line 70575), global effects in GlobalEffectVO.parseXml (bundle line 143698), sceat skills in CastleSceatSkillVO.parseBoni (bundle line 23075), general skills in GeneralSkillVO.parseXML (bundle line 113368) and gems in CastleGemVO.parseXML (bundle line 28295).

Fields:

Validators:

effects pydantic-field

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

The bonuses it grants

EquipmentEffectSpecRow pydantic-model

Bases: _Row

Base for tables whose effects column names equipment effect ids: equipment sets and default commanders.

Client: XmlEquipmentSetVO.addEffect (bundle line 144229), DefaultLordVO.parseFromXml (bundle line 102001)

Fields:

Validators:

effects pydantic-field

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

The bonuses it grants

CastleEffectValue pydantic-model

Bases: _Row

One fixed bonus of a construction item: a column named after the bonus, and its value.

Client: CastleEffectVO.createFromXML (bundle line 79059)

Fields:

effect pydantic-field

effect: CastleEffect

The bonus, the column's name

value pydantic-field

value: float

Number of the column; NaN when it is no number

from_row classmethod

from_row(row: Mapping[str, object]) -> list[CastleEffectValue]

Each bonus column with text in it, in the client's order of the bonuses.

ConstructionItemDef pydantic-model

Bases: EffectSpecRow

A construction item - the decorations placed on castle buildings.

Their bonuses are real combat bonuses: the flank unit limit item grants +2% per level, so a level 15 one is the +30% a player sees on the flanks. Besides effects, many rows grant fixed bonuses in columns of their own (castle_effects), which the game lists first.

Client: ConstructionItemVO.fillFromParamXML (bundle line 47718)

Fields:

Validators:

construction_item_id pydantic-field

construction_item_id: GameDataId['ConstructionItem']

Wire key constructionItemID

The construction item

name pydantic-field

name: str = ''

group_id pydantic-field

group_id: int = 0

Wire key constructionItemGroupID

level pydantic-field

level: int = 0

rareness_id pydantic-field

rareness_id: int = 0

Wire key rarenessID

slot_type_id pydantic-field

slot_type_id: int = 0

Wire key slotTypeID

effect_group_id pydantic-field

effect_group_id: int = 0

Wire key constructionItemEffectGroupID

duration_seconds pydantic-field

duration_seconds: int = 0

Wire key duration

Temporary item lifetime; 0 for permanent

is_premium pydantic-field

is_premium: bool = False

Wire key isPremium

A premium item; any text in the column counts

castle_effects pydantic-field

castle_effects: tuple[CastleEffectValue, ...] = ()

The fixed bonuses, one per bonus column with text in it

AllianceBuffDef pydantic-model

Bases: EffectSpecRow

One alliance buff level and its alliance treasury cost.

Client: AllianceBuffVO.fillFromParamXml (bundle lines 70591–70593), AllianceBuffData.getCosts (27731–27732).

Fields:

Validators:

alliance_buff_id pydantic-field

alliance_buff_id: int

Wire key allianceBuffID

Individual buff level row

series_id pydantic-field

series_id: GameDataId[AllianceBuffType] = 0

Wire key allianceBuffSeriesID

The upgrade or boost the level belongs to

level pydantic-field

level: int = 0

Level within the buff series

max_level pydantic-field

max_level: int = 0

Wire key maxLevel

Maximum series level

duration_seconds pydantic-field

duration_seconds: int = -1

Wire key duration

Boost duration; -1 is permanent

required_buff_id pydantic-field

required_buff_id: int = -1

Wire key requiredBuffID

Required buff; -1 is none

costs pydantic-field

costs: tuple[Collectable, ...] = ()

Costs paid from the alliance treasury

GlobalEffectDef pydantic-model

Bases: EffectSpecRow

A global (event) effect, active for everyone while its event runs.

Fields:

Validators:

global_effect_id pydantic-field

global_effect_id: GameDataId['GlobalEffect']

Wire key globalEffectID

The global effect

name pydantic-field

name: str = ''

boost_value pydantic-field

boost_value: float = 0

Wire key boostValue

min_level pydantic-field

min_level: int = 0

Wire key minLevel

max_level pydantic-field

max_level: int = 0

Wire key maxLevel

SceatSkillDef pydantic-model

Bases: EffectSpecRow

One level of a sceat skill, from the Hall of Legends trees.

Fields:

Validators:

skill_id pydantic-field

skill_id: GameDataId['SceatSkill']

Wire key skillID

The sceat skill

skill_group_id pydantic-field

skill_group_id: int = 0

Wire key skillGroupID

level pydantic-field

level: int = 0

skill_tree_id pydantic-field

skill_tree_id: int = 0

Wire key skillTreeID

tier pydantic-field

tier: int = 0

SceatSkillTreeDef pydantic-model

Bases: _Row

A Hall of Legends sceat skill tree and the tab it shows in.

Client: CastleLegendSkillData.parseXML (split.js line 576514) skips a row without a skillTreeID and files the tree under its tabID in sceatTreeTabMap

Fields:

Validators:

skill_tree_id pydantic-field

skill_tree_id: int

Wire key skillTreeID

The tree, a SceatSkill.skill_tree_id

tab_id pydantic-field

tab_id: GameDataId[SceatSkillTab] = -1

Wire key tabID

The tab it shows in; -1 for none

GeneralSkillDef pydantic-model

Bases: EffectSpecRow

One level of a general's skill.

Fields:

Validators:

skill_id pydantic-field

skill_id: GameDataId['GeneralSkill']

Wire key skillID

The general skill

general_id pydantic-field

general_id: GameDataId['General'] = 0

Wire key generalID

The general it belongs to

name pydantic-field

name: str = ''

skill_group_id pydantic-field

skill_group_id: int = 0

Wire key skillGroupID

level pydantic-field

level: int = 0

tier pydantic-field

tier: int = 0

FortificationDef pydantic-model

Bases: _Row

A wall, gate or moat building and the protection it gives.

The bonuses are the items columns, i.e. percentages: a level 3 castle wall reads 70 and protects by 0.70 once scaled.

Fields:

wod_id pydantic-field

wod_id: GameDataId['Building']

Wire key wodID

The wall, gate or moat

label pydantic-field

label: str = ''

Wire key comment2

level pydantic-field

level: int = 0

wall_bonus pydantic-field

wall_bonus: float = 0

Wire key wallBonus

gate_bonus pydantic-field

gate_bonus: float = 0

Wire key gateBonus

moat_bonus pydantic-field

moat_bonus: float = 0

Wire key moatBonus

RelicEffectDef pydantic-model

Bases: _Row

A relic effect, which is a different id space from a plain effect.

A relic item's bonus ids index this table, not effects: id 4 is perceptionBonus as a plain effect but gateReduction as a relic effect. Resolving in the wrong space yields a plausible, wrong answer.

Fields:

relic_effect_id pydantic-field

relic_effect_id: int

Wire key id

effect_id pydantic-field

effect_id: GameDataId['Effect'] = 0

Wire key effectID

The effect it resolves to

minimum_value pydantic-field

minimum_value: float = 0

Wire key minimumValue

maximum_value pydantic-field

maximum_value: float = 0

Wire key maximumValue

relic_effect_type pydantic-field

relic_effect_type: GameDataKey[RelicEffectType] = ''

Wire key relicEffectType

Its kind; empty for none

EquipmentEffectDef pydantic-model

Bases: _Row

A bonus an equipment item can roll.

Client: XmlEquipmentEffectVO.parseXml (bundle line 144158)

Fields:

Validators:

equipment_effect_id pydantic-field

equipment_effect_id: GameDataId['EquipmentEffect']

Wire key equipmentEffectID

The id an item's bonus row names

effect_id pydantic-field

effect_id: GameDataId['Effect'] = -1

Wire key effectID

The effect it resolves to; -1 when unset

bonus pydantic-field

bonus: int = 0

Bonus value

wearer_id pydantic-field

wearer_id: GameDataId[WearerType] = -1

Wire key wearerID

Who can roll it

item_group_ids pydantic-field

item_group_ids: tuple[GameDataId['EquipmentGroup'], ...] = ()

Wire key itemGroupID

The item groups that can roll it

ignore_cap pydantic-field

ignore_cap: bool = False

Wire key ignoreCap

The bonus escapes its effect's cap

GemDef pydantic-model

Bases: EffectSpecRow

A gem that can be slotted into an equipment item.

Its effects name plain effect ids.

Client: CastleGemVO.parseXML (bundle lines 28287-28291)

Fields:

Validators:

gem_id pydantic-field

gem_id: GameDataId['Gem']

Wire key gemID

The gem, as in Equipment.gem_id

level pydantic-field

level: int = 0

Wire key gemLevelID

Gem level; 0 for a unique gem

reuse_asset_of_gem_id pydantic-field

reuse_asset_of_gem_id: GameDataId['Gem'] = -1

Wire key reuseAssetOfGemID

The gem whose look and name it shares; -1 for its own

set_id pydantic-field

set_id: int = -1

Wire key setID

Equipment set the gem counts toward; -1 for none

trigger_chance pydantic-field

trigger_chance: int = 100

Wire key triggerChance

Trigger chance; the effect totals do not apply it

EquipmentSetDef pydantic-model

Bases: EquipmentEffectSpecRow

One threshold of an equipment set: the bonuses worn items of the set grant from needed_items on.

Its effects name equipment effect ids.

Client: EquipmentXml.parseEquipmentSets (bundle line 144122) groups the rows by setID; XmlEquipmentSetVO.addEffect (bundle line 144227) parses each effect with EquipmentBonusVO.parseEquipmentFromValueString (bundle line 20940).

Fields:

Validators:

row_id pydantic-field

row_id: int = -1

Wire key ID

Row id

set_id pydantic-field

set_id: int

Wire key setID

Equipment set id, as in Equipment.set_id and GemDef.set_id

needed_items pydantic-field

needed_items: int = 0

Wire key neededItems

Set items and gems worn from which the bonuses apply

LegendarySkillDef pydantic-model

Bases: _Row

One level of a Legendary skill, e.g. gateReduction.

Client: CastleLegendSkillVO.parseXML (bundle line 48652); isMaxLevel (bundle line 48717)

Fields:

Validators:

skill_id pydantic-field

skill_id: GameDataId['LegendarySkill']

Wire key skillID

The Legendary skill

level pydantic-field

level: int = 0

tier pydantic-field

tier: int = 0

skill_tree_id pydantic-field

skill_tree_id: int = 0

Wire key skillTreeID

skill_group_id pydantic-field

skill_group_id: int = 0

Wire key skillGroupID

effect_type pydantic-field

effect_type: str = ''

Wire key effectType

total_effect_value pydantic-field

total_effect_value: float = 0

Wire key totalEffectValue

total_cost_skill_points pydantic-field

total_cost_skill_points: int = 0

Wire key totalCostSkillPoints

cost_skill_points pydantic-field

cost_skill_points: int = 0

Wire key costSkillPoints

Skill points this level costs over the one before

required_skill_id pydantic-field

required_skill_id: GameDataId['LegendarySkill'] | None = None

Wire key requiredSkillID

The skill this level needs; None for none

previous_skill_id pydantic-field

previous_skill_id: GameDataId['LegendarySkill'] | None = None

Wire key previousSkillID

The level this one replaces when bought; the required skill when the row names none

following_skill_id pydantic-field

following_skill_id: GameDataId['LegendarySkill'] | None = None

Wire key followingSkillID

The next level; None at the last

is_max_level property

is_max_level: bool

Whether no level follows this one.

AttackSlotDef pydantic-model

Bases: _Row

An attack-screen slot and what unlocking it costs.

Fields:

slot_id pydantic-field

slot_id: int

Wire key slotID

Attack slot id

cost_rubies pydantic-field

cost_rubies: int = 0

Wire key costC2

Rubies to unlock the slot

ToolCategoryDef pydantic-model

Bases: _Row

A tool category, e.g. basic.

Fields:

tool_category_id pydantic-field

tool_category_id: int

Wire key toolCategoryID

name pydantic-field

name: str = ''

HorseStats pydantic-model

Bases: _Row

A travel booster - the value behind the HBW field on movements.

The game names a horse only by its button's place in the travel dialog, the tooltip text horse<n> (ACastlePostActionDialog.calculateTooltip, bundle line 27269), not by its row, so the Horse enum is named from the two designer labels.

Client: HorseTravelboosterVO.parseXmlNode (bundle line 118814) after AVisualVO.parseXmlNode (bundle line 17800), read from the horses table

Fields:

Validators:

wod_id pydantic-field

wod_id: GameDataId['Horse']

Wire key wodID

The horse, the value sent as HBW

source pydantic-field

source: str = ''

Wire key name

The row's name, Horse for every row

group pydantic-field

group: str = ''

The row's group, Travelbooster for every row

label pydantic-field

label: str = ''

Wire key comment2

Designer label the game does not read, e.g. Warhorse or Fast Ship

building_label pydantic-field

building_label: str = ''

Wire key comment1

Designer label the game does not read, e.g. Stable1 or Harbor3

horse_type pydantic-field

horse_type: str = ''

Wire key type

The horse's type within its building

unit_boost pydantic-field

unit_boost: int = 0

Wire key unitBoost

Travel speed bonus percent for troops

market_boost pydantic-field

market_boost: int = 0

Wire key marketBoost

Travel speed bonus percent for traders

spy_boost pydantic-field

spy_boost: int = 0

Wire key spyBoost

Travel speed bonus percent for spies

cost_factor_c1 pydantic-field

cost_factor_c1: float = 0

Wire key costFactorC1

Coin cost multiplier; 0 when not paid in coins

cost_factor_c2 pydantic-field

cost_factor_c2: float = 0

Wire key costFactorC2

Ruby cost multiplier; 0 when not paid in rubies

is_instant_spy_horse pydantic-field

is_instant_spy_horse: bool = False

Wire key isInstantSpyHorse

Can be paid with feathers as well as rubies

DefaultCommanderDef pydantic-model

Bases: EquipmentEffectSpecRow

A default commander, one of the negative commander ids.

-14 is the bought premium commander, -15 the commander of a robber baron attack, -21 the NPC that holds a camp, and so on. Its effects name equipment effect ids.

Client: DefaultLordVO.parseFromXml (bundle line 101999) parses each effect with EquipmentBonusVO.parseEquipmentFromValueString.

Fields:

Validators:

commander_id pydantic-field

commander_id: int

Wire key lordID

commander_type pydantic-field

commander_type: str = ''

Wire key type

wearer_id pydantic-field

wearer_id: GameDataId[WearerType] = 0

Wire key wearerID

Who wears it

GeneralAbilityDef pydantic-model

Bases: _Row

One level of a general's ability, the value set_abilities sends per slot.

Client: GeneralAbilityXmlVO.fillFromParamXml (bundle line 113203), keyed by abilityID in GeneralsData (bundle line 113021)

Fields:

Validators:

ability_id pydantic-field

ability_id: GameDataId['GeneralAbility'] = 0

Wire key abilityID

The ability, the value set_abilities sends

name pydantic-field

name: str = ''

Ability name, unique per level

ability_group_id pydantic-field

ability_group_id: int = 0

Wire key abilityGroupID

The group the levels share

level pydantic-field

level: int = 0

Ability level

ability_trigger_id pydantic-field

ability_trigger_id: int = 0

Wire key abilityTriggerID

What triggers the ability

trigger_per_wave pydantic-field

trigger_per_wave: int = 0

Wire key triggerPerWave

Triggers per wave

ability_attack_effect_id pydantic-field

ability_attack_effect_id: int = 0

Wire key abilityAttackEffectID

Effect while attacking

ability_defense_effect_id pydantic-field

ability_defense_effect_id: int = 0

Wire key abilityDefenseEffectID

Effect while defending

CurrencyDef pydantic-model

Bases: _Row

A currency; json_key is the key the server uses for it in currency lists.

The caps, rareness and hidden flags the client reads from other tables are not parsed.

Client: XmlCurrencyVO.parseXml (bundle line 141282), read from the currencies table by CurrencyData.parseXml (bundle line 141151)

Fields:

Validators:

currency_id pydantic-field

currency_id: GameDataId['CurrencyId'] = -1

Wire key currencyID

The currency; -1 when unset

name pydantic-field

name: str = ''

Wire key Name

Internal name

json_key pydantic-field

json_key: str = ''

Wire key JSONKey

The key the server uses for it, e.g. GXP1

asset_name pydantic-field

asset_name: str = ''

Wire key assetName

Icon asset name

name_text_id property

name_text_id: str

The text id of its name, currency_name_<assetName or Name>.

Client: CollectableItemGenericCurrencyVO.getNameTextId and getNameOrAssetName (bundle lines 5267 and 5273)

VipLevelDef pydantic-model

Bases: _Row

A VIP level: the VIP points it spans, the premium commanders it gives free each day and its attack speed bonus.

The other bonuses the client reads from the row are not parsed.

Client: VIPLevelInfoVO.parseConfigXML and inPointRange (bundle lines 400638, 400754), read from the viplevels table by CastleVIPData.parseVIPLevels (bundle line 245583)

Fields:

Validators:

vip_level_id pydantic-field

vip_level_id: int = -1

Wire key vipLevelID

VIP level, 1 and up

min_points pydantic-field

min_points: int = 0

Wire key thresholdMin

The fewest VIP points at this level

max_points pydantic-field

max_points: int = 0

Wire key thresholdMax

The most VIP points at this level

free_premium_commanders_per_day pydantic-field

free_premium_commanders_per_day: int = 0

Wire key freePremiumGeneralsPerDay

Premium commanders a day that cost no rubies while VIP time runs

attack_speed_bonus pydantic-field

attack_speed_bonus: int = 0

Wire key attackSpeedBoost

Travel speed bonus percent for attacks while VIP time runs

in_point_range

in_point_range(points: int) -> bool

Whether points VIP points fall in this level, both ends included.

LevelBoosterDef pydantic-model

Bases: _Row

One level of a King's Market booster bought in levels: the caravan overloader or the return speed booster.

Client: CastlePremiumBoostData.parseXML (bundle line 81350), read from the levelBoosters table

Fields:

Validators:

booster pydantic-field

Wire key boosterType

The booster

level pydantic-field

level: int

Booster level, 0 before the first purchase

boost_percent pydantic-field

boost_percent: int

Wire key boostPercentage

Its bonus in percent at this level

cost_rubies pydantic-field

cost_rubies: int

Wire key costC2

Rubies this level costs

MonumentLevelDef pydantic-model

Bases: _Row

A monument level: the glory bonus it gives and the upgrade points that reach it.

A row without a readable level is left out: the client keys it as NaN, which no lookup reaches.

Client: MonumentLevelInfoVO.parseXML (split.js line 375127), read from the monuments table by CastleMonumentData.parseXML (split.js line 239069), which keys the rows by level

Fields:

Validators:

level pydantic-field

level: int

The monument level

glory_bonus pydantic-field

glory_bonus: int | None = None

Wire key fameBoost

Percent glory bonus when attacking; None if unreadable

required_points pydantic-field

required_points: int | None = None

Wire key requiredPoints

Upgrade points that reach this level; None if unreadable, and then never reached

LaboratoryLevelDef pydantic-model

Bases: _Row

A laboratory level in one kingdom: the production bonus it gives and the upgrade points that reach it.

A row without a readable level or kingdom is left out: the client keys it as NaN, which no lookup reaches.

Client: LaboratoryLevelInfoVO.parseXML and landmarkBonus (split.js lines 672286, 672323), read from the laboratories table by CastleLaboratoryData.parseXML (split.js line 672181), which keys the rows by kingdom and level

Fields:

Validators:

level pydantic-field

level: int

The laboratory level

kingdom pydantic-field

kingdom: GameDataId[Kingdom] = Kingdom.GREEN

Wire key kID

The kingdom whose laboratories have this level

iron_bonus pydantic-field

iron_bonus: int = 0

Wire key ironAllianceBoost

Percent production bonus on iron ore

charcoal_bonus pydantic-field

charcoal_bonus: int = 0

Wire key charcoalAllianceBoost

Percent production bonus on charcoal

olive_oil_bonus pydantic-field

olive_oil_bonus: int = 0

Wire key oliveOilAllianceBoost

Percent production bonus on olive oil

glass_bonus pydantic-field

glass_bonus: int = 0

Wire key glassAllianceBoost

Percent production bonus on glass

required_points pydantic-field

required_points: int | None = 0

Wire key requiredPoints

Upgrade points that reach this level; None if unreadable, and then never reached

production_bonus property

production_bonus: int

The bonus the laboratory gives: the highest of its four.

RaidBossDef pydantic-model

Bases: _Row

An alliance raid boss.

Client: AllianceRaidbossVO.parseXML (bundle line 113835), read from the raidBosses table by RaidBossData (bundle line 113671)

Fields:

Validators:

raid_boss_id pydantic-field

raid_boss_id: GameDataId['RaidBoss'] = 0

Wire key raidBossID

The raid boss

name pydantic-field

name: str = ''

Internal name, unique

rarity pydantic-field

rarity: int = 0

Rarity

GeneralDef pydantic-model

Bases: _Row

A general, the hero assigned to a commander.

Client: GeneralXmlVO.fillFromParamXml (bundle line 33102)

Fields:

Validators:

general_id pydantic-field

general_id: GameDataId['General']

Wire key generalID

The general

name pydantic-field

name: str = ''

Wire key generalName

Internal name, unique per general

raw_attack_slots pydantic-field

raw_attack_slots: str = ''

Wire key attackSlots

raw_defense_slots pydantic-field

raw_defense_slots: str = ''

Wire key defenseSlots

rarity_id pydantic-field

rarity_id: GameDataId['GeneralRarity'] = 2

Wire key generalRarityID

Its rarity, which prices unlocking and stars

max_level pydantic-field

max_level: int = 0

Wire key maxLevel

max_star_level pydantic-field

max_star_level: int = 0

Wire key maxStarLevel

unlock_currency_id pydantic-field

unlock_currency_id: GameDataId['CurrencyId'] = 0

Wire key unlockCurrencyID

The shard that unlocks it; 0 for none

upgrade_currency_ids pydantic-field

upgrade_currency_ids: tuple[GameDataId['CurrencyId'], ...] = ()

Wire key upgradeCurrencyIDs

The shards that raise its star level

is_preview pydantic-field

is_preview: bool = False

Wire key isPreview

Shown ahead of its release; it cannot be unlocked

is_implemented property

is_implemented: bool

Whether the general is out, and so can be unlocked: GeneralXmlVO.isImplemented.

Client: GeneralXmlVO.fillFromParamXml (bundle line 33102)

attack_slots property

attack_slots: tuple[int, ...]

defense_slots property

defense_slots: tuple[int, ...]

DungeonDefence pydantic-model

Bases: _Row

What defends a robber baron camp, or a treasure map dungeon, at a given victory count.

The client reads only kID, countVictories and skipCosts of a row (CastleDungeonData.generateData, bundle line 111754); it never reads the defenders or the commander. SpyArmy.from_robber_baron_camp lays the defenders out as a spy report would.

Fields:

Validators:

count_victories pydantic-field

count_victories: int = 0

Wire key countVictories

kingdom_id pydantic-field

kingdom_id: GameDataId[Kingdom] = 0

Wire key kID

The kingdom; a treasure map's camp has its map's kID

commander pydantic-field

commander: DefaultCommanderDef | None = None

Wire key lordID

The default commander holding the camp, from the lords table

skip_costs pydantic-field

skip_costs: int = 0

Wire key skipCosts

raw_units_left pydantic-field

raw_units_left: str = ''

Wire key unitsL

raw_units_middle pydantic-field

raw_units_middle: str = ''

Wire key unitsM

raw_units_right pydantic-field

raw_units_right: str = ''

Wire key unitsR

raw_units_keep pydantic-field

raw_units_keep: str = ''

Wire key unitsK

raw_tools_left pydantic-field

raw_tools_left: str = ''

Wire key toolL

raw_tools_middle pydantic-field

raw_tools_middle: str = ''

Wire key toolM

raw_tools_right pydantic-field

raw_tools_right: str = ''

Wire key toolR

NpcCampDefence pydantic-model

Bases: _Row

An event camp's defense, shared shape across the camp tables.

Covers the nomad, samurai, Berimond invasion and alliance invasion camps.

Client: CastleInvasionCampNodeVO.parseXML (bundle line 39701)

Fields:

count_victory pydantic-field

count_victory: int = 0

Wire key countVictory

def_strength pydantic-field

def_strength: int = 0

Wire key defStrength

raw_defense_units pydantic-field

raw_defense_units: str = ''

Wire key defenceUnits

raw_defense_tools pydantic-field

raw_defense_tools: str = ''

Wire key defenceTools

wall_bonus pydantic-field

wall_bonus: float = 0

Wire key wallBonus

gate_bonus pydantic-field

gate_bonus: float = 0

Wire key gateBonus

commander_id pydantic-field

commander_id: int = 0

Wire key lordID

guards pydantic-field

guards: int = 0

unit_wall_count pydantic-field

unit_wall_count: int = 0

Wire key unitWallCount

cool_down pydantic-field

cool_down: int = 0

Wire key coolDown

dungeon_level pydantic-field

dungeon_level: int = 0

Wire key dungeonlevel

faction_id pydantic-field

faction_id: GameDataId[BerimondFaction] = BerimondFaction.URSIDAE

Wire key factionID

The Berimond faction a Berimond invasion camp row is for

defense_unit_ids property

defense_unit_ids: tuple[int, ...]

defense_tool_ids property

defense_tool_ids: tuple[int, ...]

DaimyoCastleDef pydantic-model

Bases: _DaimyoAreaRow

A daimyoCastles row, by the id a daimyo castle's map row names.

Client: DaimyoCastleXmlData.getDaimyoCastleByID (bundle line 141388)

Fields:

camp_id pydantic-field

camp_id: GameDataId['DaimyoCastle'] = 0

Wire key id

The row

DaimyoTownshipDef pydantic-model

Bases: _DaimyoAreaRow

A daimyoTownships row, by the id a township's map row names.

Client: DaimyoTownshipXmlData.getDaimyoTownshipByID (bundle line 141410)

Fields:

camp_id pydantic-field

camp_id: GameDataId['DaimyoTownship'] = 0

Wire key id

The row

LeagueBracketDef pydantic-model

Bases: _Row

A league: the level band an event sorts a player into, a row of leaguetypes.

Its league_type_id is the LID of the highscore commands. Ids repeat across events, and within an event across sub types. An invasion camp's base level is the band's lower victory count, so this is also what says how hard the samurai camps are for a player of a given level.

Client: AScoreEventVO.generateLeagueLevelsList (bundle line 14971), LeagueTypeVO.parseXML (bundle line 91460)

Fields:

Validators:

league_type_id pydantic-field

league_type_id: GameDataId['LeagueType'] | None = None

Wire key leaguetypeID

League type id; None when the row has none

event_id pydantic-field

event_id: GameDataId['Event'] | None = None

Wire key eventID

The event it belongs to; -1 for none, None when the row has none

sub_type pydantic-field

sub_type: int = 0

Wire key subType

The event's sub type, e.g. a Berimond faction

min_level pydantic-field

min_level: int = 0

Wire key minLevel

Lowest player level in the league

max_level pydantic-field

max_level: int = 0

Wire key maxLevel

Highest player level in the league

victory_min pydantic-field

victory_min: int = 0

Wire key countVictoryMin

Lower victory count

victory_max pydantic-field

victory_max: int = 0

Wire key countVictoryMax

Upper victory count

parse_stacks

parse_stacks(value: str | None) -> list[tuple[int, int]]

Parse the wodID+count#wodID+count encoding used for camp defenses.

Unparseable segments are skipped rather than failing the row.

parse_ids

parse_ids(value: str | None) -> tuple[int, ...]

Parse a comma-separated ID list.

is_castle_effect_column

is_castle_effect_column(column: str) -> bool

Whether a constructionItems column is a fixed bonus (CastleEffectValue).

gamedata.tables

Typed rows of the items tables the generated id enums name: buildings, researches, events, loot boxes, equipment groups, difficulty types, quests, daily quests, titles, achievements and alliance crest layouts and colours, plus difficulty scaling camps and the rewards.

Each model reads the columns its client value object reads, with the same defaults. The rewards rows are read into collectables (CollectableParserX2CRewards, bundle line 62897); the costs and other collectable columns the client reads with CollectableParserX2CList (bundle line 62874) from other tables are not read yet.

Classes:

Name Description
BuildingDef

A building: what every building, tower, gate, moat and decoration row has in common.

ResearchDef

One level of a research.

EventDef

An event: who sees it and where.

LootBoxDef

A loot box.

LootBoxTypeDef

A loot box type, whose keys count toward a free box.

GeneralRarityDef

A general rarity: the shards that unlock a general of it and raise its stars, and the xp of each level.

GeneralsHubCharacterDef

A character of the generals hub's inn, who spins a tombola for an offering.

GemColorDef

A gem colour, by which the auto-sell rules sell gems.

EquipmentGroupDef

An equipment item group, as equipment effects name them.

DifficultyTypeDef

An event difficulty type, e.g. easyPlus.

QuestCondition

One thing a quest counts: a type+amount+data part of its conditions.

QuestDef

A quest: where it shows, what unlocks it and what it counts.

DailyQuestDef

A daily quest.

TitleDef

A title of the glory, Berimond or Storm Islands title systems.

AchievementCondition

One thing an achievement counts: a type+amount+params part of its conditions.

AchievementDef

One step of an achievement series.

AllianceCrestColorDef

A colour an alliance crest can use.

AllianceCrestLayoutDef

A layout an alliance crest can use, and the bonuses it grants.

ConstructionItemRecipeDef

A recipe that crafts a construction item, one of a blueprint's.

PrebuiltCastleDef

A castle or camp you start a kingdom, a season event's map or a special server with, and its price.

SpecialServerPrebuiltCastleDef

A prebuilt castle as a special server's castle selection offers it: the Outer Realms, Beyond the Horizon or

StartResourcesDef

The goods a special server's prebuilt castle starts with.

PrivateVillageDef

One level of a private resource village, bought with resource village tokens.

CraftingRecipeDef

A recipe a crafting queue crafts.

CraftingQueueDef

A crafting queue's slots: those it always has, and the temporary ones coins unlock for a while.

FusionSystemDef

A fusion forge's energy and fusion rules.

FusionForgeDef

A fusion forge's dust and daily minute skips.

JudgementDef

A citizen judgement: where it appears, and what each verdict asks and gives.

CoatOfArmsSymbolDef

A symbol for a coat of arms. One with a required achievement is a premium symbol: that achievement

PackageDef

An event package: what a shop sells for a fixed price, and what a gift package holds.

PlayerNameChangeDef

The ruby price of one of your player name changes, by its number.

ScalingCampDef

A camp of an event's difficulty scaling: the level and costs a chosen difficulty gives it.

DaimyoContractDef

An alliance contract of the daimyo event: one level of a contract rank.

RewardDef

One reward of the items: what it gives, and to whom.

TreasureMapDef

A treasure map: a season event's map or one of the treasure hunt's, with its nodes and prices.

TreasureMapNodeDef

A node of a treasure map: a camp, an obstacle or a port, and the nodes that unlock it.

PartPayPriceDef

A price paid in parts: a season map's obstacle, a treasure map node's or a slum level's.

DonationItemDef

What a donation event takes, and the points it gives. Its set, donation type and resource are not read.

DonationSettingDef

A donation event's run settings: which donation items it takes and which rewards it gives.

TrainingProgramDef

A training program of the officers' school: the bonus it gives against one event's targets, and its prices.

EventDifficultyDef

A difficulty an event offers, and what unlocking a locked one costs.

GachaDef

A level of a gacha event: the pulls it covers and how many one buy may make.

WheelOfFortuneRewardSetDef

A Wheel of Fortune jackpot set: the rewards a jackpot spin can win.

WheelOfFortuneWinClassDef

A Wheel of Fortune win class: the spins to the next class, the rubies a skipped spin costs, and the previews.

OuterRealmsSettingDef

An Outer Realms run's settings. Only some columns are read: the presets and rewards are not.

HorizonSettingDef

A Beyond the Horizon run's settings. Only some columns are read: the presets, map and rewards are not.

FeastDef

A feast you can hold for faster recruitment in every castle: its price, bonus, duration and the levels it is

AllianceTowerEffectDef

An alliance tower effect of Beyond the Horizon: the bonus it gives, and how its price and strength grow per level.

AllianceInvasionCampDef

An alliance invasion camp, by the id an aic push names it with while its event scales no difficulty; with a

OasisSettlementDef

One level of a Beyond the Horizon Oasis Settlement: the trades it offers, its cooldown and the army it takes.

OasisTradeDef

A trade an Oasis Settlement offers: the materials one trade costs and what it brings.

CitadelLevelDef

One level of the alliance Citadel in Beyond the Horizon's Jade Desert: its reach, defence and upgrade price.

LeagueTypeEventDef

One league's points thresholds and rewards in one event, for one reward set.

LeaderboardRewardDef

The rewards of one rank band of an event's leaderboard, in one reward set.

BerimondSpecialCampDef

A Battle for Berimond special camp: a watchtower, a capital or the resource village, by the id map rows and the

Functions:

Name Description
row_id

The row's own id, parseInt of it; a row without one is skipped, as nothing can look it up.

is_cost_column

Whether an items column is a cost<name> column.

Attributes:

Name Type Description
RewardId

The id of a rewards row, whose collectables GameData.reward_list gives.

CoatOfArmsSymbolId

The id of a crestsymbols row, a coat of arms symbol that GameData.coat_of_arms_symbols describes.

PackageId

The id of a packages row, an event package that GameData.packages describes.

ConstructionItemRecipeId

The id of a constructionItemRecipes row, a recipe that GameData.construction_item_recipes describes.

TreasureMapNodeId

The id of a tmapnodes row, a node of a treasure map that GameData.treasure_map_nodes describes.

CraftingRecipeId

The id of a craftingRecipes row, a recipe that GameData.crafting_recipes describes.

CraftingQueueId

The queueTypeId of a craftingQueues row, the crafting queue GameData.crafting_queues describes.

StartResourcesId

The id of a startResources row, the goods GameData.start_resources gives a special server's castle.

PartPayPriceId

The id of a partpayprices row, a price paid in parts that GameData.part_pay_prices describes.

DonationItemId

The id of a donationItems row, what a donation event takes, that GameData.donation_items describes.

DonationSettingId

The id of a donationSettings row, a donation event's run settings, that GameData.donation_settings

TrainingProgramId

The id of an officersSchoolEffects row, a training program that GameData.training_programs describes.

EventDifficultyId

The id of an eventAutoScalingDifficulties row, an event difficulty that GameData.event_difficulties

GachaId

The id of a gachaEvents row, a gacha level that GameData.gachas describes.

WheelOfFortuneRewardSetId

The id of a luckywheelrewardsets row, a Wheel of Fortune jackpot set that

WheelOfFortuneWinClassId

The id of a luckywheelclasses row, a Wheel of Fortune win class that

OuterRealmsSettingId

The id of a tempServerSettings row, an Outer Realms run's settings that GameData.outer_realms_settings

HorizonSettingId

The id of an allianceBattleGroundSettings row, a Beyond the Horizon run's settings that

OasisSettlementId

The id of a tradingCamps row, a Beyond the Horizon Oasis Settlement level that

OasisTradeId

The id of a trades row, a trade an Oasis Settlement offers that GameData.oasis_trades describes.

CitadelLevelId

The id of an allianceCitadels row, a level of the alliance Citadel that GameData.citadel_levels

DaimyoContractId

The id of a daimyo alliance contract, a row of GameData.daimyo_castle_contracts or

ScalingCampId

The id of an eventAutoScalingCamps row, a camp of an event's difficulty scaling that

AllianceInvasionCampId

The id of an allianceInvasionCamps row, an alliance invasion camp that GameData.alliance_invasion_camps

RewardSetId

The reward set a league score event's RSID names: which GameData.league_type_events rows give its

LeagueTypeEventId

The id of a leaguetypeevents row, a league's rewards in one event that GameData.league_type_events

LeaderboardRewardSetId

The reward set a score event's LRSI names: which GameData.leaderboard_rewards rows give its leaderboard's

LeaderboardRewardId

The id of a leaderboardRewards row, one rank band's rewards that GameData.leaderboard_rewards

RewardId module-attribute

RewardId = NewType('RewardId', int)

The id of a rewards row, whose collectables GameData.reward_list gives.

The rows have no name, so no generated enum names them; this type marks the id space instead.

CoatOfArmsSymbolId module-attribute

CoatOfArmsSymbolId = NewType('CoatOfArmsSymbolId', int)

The id of a crestsymbols row, a coat of arms symbol that GameData.coat_of_arms_symbols describes.

The rows have no name, so no generated enum names them; this type marks the id space instead.

PackageId module-attribute

PackageId = NewType('PackageId', int)

The id of a packages row, an event package that GameData.packages describes.

The rows have no name the game shows, so no generated enum names them; this type marks the id space instead.

ConstructionItemRecipeId module-attribute

ConstructionItemRecipeId = NewType('ConstructionItemRecipeId', int)

The id of a constructionItemRecipes row, a recipe that GameData.construction_item_recipes describes.

The rows have no name, so no generated enum names them; this type marks the id space instead.

TreasureMapNodeId module-attribute

TreasureMapNodeId = NewType('TreasureMapNodeId', int)

The id of a tmapnodes row, a node of a treasure map that GameData.treasure_map_nodes describes.

The rows have no name, so no generated enum names them; this type marks the id space instead.

CraftingRecipeId module-attribute

CraftingRecipeId = NewType('CraftingRecipeId', int)

The id of a craftingRecipes row, a recipe that GameData.crafting_recipes describes.

The rows have no name, so no generated enum names them; this type marks the id space instead.

CraftingQueueId module-attribute

CraftingQueueId = NewType('CraftingQueueId', int)

The queueTypeId of a craftingQueues row, the crafting queue GameData.crafting_queues describes.

The rows have no name, so no generated enum names them; this type marks the id space instead.

StartResourcesId module-attribute

StartResourcesId = NewType('StartResourcesId', int)

The id of a startResources row, the goods GameData.start_resources gives a special server's castle.

The rows have no name, so no generated enum names them; this type marks the id space instead.

PartPayPriceId module-attribute

PartPayPriceId = NewType('PartPayPriceId', int)

The id of a partpayprices row, a price paid in parts that GameData.part_pay_prices describes.

DonationItemId module-attribute

DonationItemId = NewType('DonationItemId', int)

The id of a donationItems row, what a donation event takes, that GameData.donation_items describes.

DonationSettingId module-attribute

DonationSettingId = NewType('DonationSettingId', int)

The id of a donationSettings row, a donation event's run settings, that GameData.donation_settings describes.

TrainingProgramId module-attribute

TrainingProgramId = NewType('TrainingProgramId', int)

The id of an officersSchoolEffects row, a training program that GameData.training_programs describes.

EventDifficultyId module-attribute

EventDifficultyId = NewType('EventDifficultyId', int)

The id of an eventAutoScalingDifficulties row, an event difficulty that GameData.event_difficulties describes.

GachaId module-attribute

GachaId = NewType('GachaId', int)

The id of a gachaEvents row, a gacha level that GameData.gachas describes.

WheelOfFortuneRewardSetId module-attribute

WheelOfFortuneRewardSetId = NewType('WheelOfFortuneRewardSetId', int)

The id of a luckywheelrewardsets row, a Wheel of Fortune jackpot set that GameData.wheel_of_fortune_reward_sets describes.

WheelOfFortuneWinClassId module-attribute

WheelOfFortuneWinClassId = NewType('WheelOfFortuneWinClassId', int)

The id of a luckywheelclasses row, a Wheel of Fortune win class that GameData.wheel_of_fortune_win_classes describes; the classes count up from 1.

OuterRealmsSettingId module-attribute

OuterRealmsSettingId = NewType('OuterRealmsSettingId', int)

The id of a tempServerSettings row, an Outer Realms run's settings that GameData.outer_realms_settings describes.

HorizonSettingId module-attribute

HorizonSettingId = NewType('HorizonSettingId', int)

The id of an allianceBattleGroundSettings row, a Beyond the Horizon run's settings that GameData.horizon_settings describes.

OasisSettlementId module-attribute

OasisSettlementId = NewType('OasisSettlementId', int)

The id of a tradingCamps row, a Beyond the Horizon Oasis Settlement level that GameData.oasis_settlements describes.

OasisTradeId module-attribute

OasisTradeId = NewType('OasisTradeId', int)

The id of a trades row, a trade an Oasis Settlement offers that GameData.oasis_trades describes.

CitadelLevelId module-attribute

CitadelLevelId = NewType('CitadelLevelId', int)

The id of an allianceCitadels row, a level of the alliance Citadel that GameData.citadel_levels describes.

DaimyoContractId module-attribute

DaimyoContractId = NewType('DaimyoContractId', int)

The id of a daimyo alliance contract, a row of GameData.daimyo_castle_contracts or GameData.daimyo_township_contracts: each table counts its own.

ScalingCampId module-attribute

ScalingCampId = NewType('ScalingCampId', int)

The id of an eventAutoScalingCamps row, a camp of an event's difficulty scaling that GameData.scaling_camps describes.

AllianceInvasionCampId module-attribute

AllianceInvasionCampId = NewType('AllianceInvasionCampId', int)

The id of an allianceInvasionCamps row, an alliance invasion camp that GameData.alliance_invasion_camps describes.

RewardSetId module-attribute

RewardSetId = NewType('RewardSetId', int)

The reward set a league score event's RSID names: which GameData.league_type_events rows give its leagues' rewards. Not a rewards row; 0 picks no set.

LeagueTypeEventId module-attribute

LeagueTypeEventId = NewType('LeagueTypeEventId', int)

The id of a leaguetypeevents row, a league's rewards in one event that GameData.league_type_events describes.

LeaderboardRewardSetId module-attribute

LeaderboardRewardSetId = NewType('LeaderboardRewardSetId', int)

The reward set a score event's LRSI names: which GameData.leaderboard_rewards rows give its leaderboard's rank rewards. Not a rewards row.

LeaderboardRewardId module-attribute

LeaderboardRewardId = NewType('LeaderboardRewardId', int)

The id of a leaderboardRewards row, one rank band's rewards that GameData.leaderboard_rewards describes.

PACKAGE_TYPE_BUNDLE module-attribute

PACKAGE_TYPE_BUNDLE = 'packageBundle'

A package that gives the rewards of the packages it names.

Client: ClientConstPackages.PACKAGE_TYPE_BUNDLE (split.js line 27633)

BuildingDef pydantic-model

Bases: EffectSpecRow

A building: what every building, tower, gate, moat and decoration row has in common.

The per-building columns the client's building subclasses read on top (storage, production, hospital capacity, ...) are not read; fortifications has the walls, gates and moats. Nor are the collectable lists AShopVO.parseXmlNode reads with its items parsers: the cost* columns (costs) other than costC2, the sell* columns other than sellC1 (the sell list) and tempServerCostWood and tempServerCostStone (Outer Realms repair costs).

Client: AVisualVO.parseXmlNode (bundle line 17800), AShopVO.parseXmlNode (bundle lines 31713-31715), ABasicBuildingVO.parseXmlNode, parseEffects and parseAreaSpecificEffects (bundle lines 17842-17864)

Fields:

Validators:

building_id pydantic-field

building_id: GameDataId['Building']

Wire key wodID

The building

name pydantic-field

name: str = ''

Building name, shared across levels, e.g. Keep

group pydantic-field

Building group, e.g. Building or Tower

building_type pydantic-field

building_type: str = ''

Wire key type

Building type, e.g. Level1; empty for none

level pydantic-field

level: int = -1

Upgrade level; -1 when the row has none

required_level pydantic-field

required_level: int = 0

Wire key requiredLevel

Player level needed to build it

required_legendary_level pydantic-field

required_legendary_level: int = 0

Wire key requiredLegendLevel

Legendary level needed to build it

early_unlock_required_level pydantic-field

early_unlock_required_level: int = 0

Wire key earlyUnlockRequiredLevel

Player level from which it can be unlocked early

upgrade_building_id pydantic-field

upgrade_building_id: GameDataId['Building'] = 0

Wire key upgradeWodID

The building it upgrades to; 0 for none

downgrade_building_id pydantic-field

downgrade_building_id: GameDataId['Building'] = 0

Wire key downgradeWodID

The building it downgrades to; 0 for none

shop_category pydantic-field

shop_category: str = 'NOT_IN_SHOP'

Wire key shopCategory

Build menu category; NOT_IN_SHOP for none

xp pydantic-field

xp: int = 0

Experience for building it

might_value pydantic-field

might_value: int = 0

Wire key mightValue

Might points it gives

storeable pydantic-field

storeable: bool = False

It can be put into storage

maximum_count pydantic-field

maximum_count: int = 1000000

Wire key maximumCount

How many a castle may have

destructable pydantic-field

destructable: bool = True

It can be torn down

outer_realms_destructable pydantic-field

outer_realms_destructable: bool = True

Wire key tempServerDestructable

It can be torn down on the Outer Realms

horizon_only pydantic-field

horizon_only: bool = False

Wire key isBattleGround

Built in Beyond the Horizon only

never_on_horizon pydantic-field

never_on_horizon: bool = False

Wire key isNotBattleGround

Never built in Beyond the Horizon

slum_level_needed pydantic-field

slum_level_needed: int = 0

Wire key slumLevelNeeded

Slum level needed to build it

needs_construction_expert pydantic-field

needs_construction_expert: bool = False

Wire key constructionExpert

Building it needs the construction expert

sell_coins pydantic-field

sell_coins: int = 0

Wire key sellC1

Coins for selling it

cost_rubies pydantic-field

cost_rubies: int = 0

Wire key costC2

Rubies it costs to build or upgrade to

sort_order pydantic-field

sort_order: float = 1000000

Wire key sortOrder

Order in the build menu; a value that is no number sorts last

only_in_area_types pydantic-field

only_in_area_types: tuple[GameDataId[MapItemType], ...] = ()

Wire key onlyInAreaTypes

The castle types it may be built in; empty for any

only_in_kingdoms pydantic-field

only_in_kingdoms: tuple[GameDataId[Kingdom], ...] = ()

Wire key kIDs

The kingdoms it may be built in; empty for every kingdom

only_in_event_ids pydantic-field

only_in_event_ids: tuple[GameDataId['Event'], ...] = ()

Wire key eventIDs

The events it may be built in; empty for none in particular

available_in_map_ids pydantic-field

available_in_map_ids: tuple[GameDataId['TreasureMapId'], ...] = ()

Wire key mapIDs

The season event maps it may be built on; empty for any

sceat_skill_id pydantic-field

sceat_skill_id: GameDataId['SceatSkill'] = 0

Wire key sceatSkillLocked

The sceat skill that unlocks it; 0 for none

construction_item_group_ids pydantic-field

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

Wire key constructionItemGroupIDs

The construction item groups it takes

low_level_build_durations pydantic-field

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

Wire key lowLevelBuildDuration

Build times in seconds at the lowest player levels

low_level_main_castle_cost_rubies pydantic-field

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

Wire key lowLevelMainCastleCostC2

Ruby costs in the main castle at the lowest player levels

effect_locked pydantic-field

effect_locked: bool = False

Wire key effectLocked

Its effects need unlocking

wall_bonus pydantic-field

wall_bonus: int = 0

Wire key wallBonus

Wall protection, in percent

moat_bonus pydantic-field

moat_bonus: int = 0

Wire key moatBonus

Moat protection, in percent

build_duration pydantic-field

build_duration: int = 0

Wire key buildDuration

Build time in seconds

building_ground_type pydantic-field

building_ground_type: GameDataKey[BuildingGroundType] = BuildingGroundType.NONE

Wire key buildingGroundType

The ground it stands on

district_type_id pydantic-field

district_type_id: int = 0

Wire key districtTypeID

The district type it belongs to

is_district pydantic-field

is_district: bool = False

Wire key isDistrict

It is a district

is_relic_building pydantic-field

is_relic_building: bool = False

Wire key isRelicBuilding

It is a relic building

area_specific_effects pydantic-field

area_specific_effects: tuple[EffectValue, ...] = ()

Wire key areaSpecificEffects

Bonuses that count only where their effect's conditions hold

rubies_to_build

rubies_to_build(player_level: int | None) -> int

The rubies it costs to build, before cost effects: low_level_main_castle_cost_rubies for the player's level when it names one, else cost_rubies, and 0 at level 0. With the level unknown, the most either could be.

Client: ABasicBuildingVO.costC2 (bundle lines 17950-17953)

seconds_to_build

seconds_to_build(player_level: int) -> int

Its build time in seconds before boosts: low_level_build_durations for the player's level when that is above 0, else build_duration.

Client: ABasicBuildingVO.basicBuildDuration (bundle lines 17888-17890)

ResearchDef pydantic-model

Bases: EffectSpecRow

One level of a research.

costs and outer_realms_costs read every cost column of the row (see Collectable.from_columns), a currency named by its Name (costLegendaryToken) by the currency names GameData passes in as validation context (currency_ids).

Client: AResearchVO.fillFromParamXML (bundle lines 61502-61516); getBaseCosts (bundle line 61530) picks outer_realms_costs on the Outer Realms, and getFinalCosts (bundle line 61531) applies discounts to them

Fields:

Validators:

research_id pydantic-field

research_id: GameDataId['Research']

Wire key researchID

The research

label pydantic-field

label: str = ''

Wire key comment2

Designer label the game does not read, e.g. recruitment speed

group_id pydantic-field

group_id: int = -1

Wire key groupID

The group the research's levels share

level pydantic-field

level: int = -1

Research level

prerequisite_ids pydantic-field

prerequisite_ids: tuple[GameDataId['Research'], ...] = ()

Wire key prerequisiteIDs

Researches it needs first

min_research_tower_level pydantic-field

min_research_tower_level: int = 1

Wire key minResearchTowerLevel

Research tower level it needs

required_level pydantic-field

required_level: int = 0

Wire key requiredLevel

Player level it needs

required_legendary_level pydantic-field

required_legendary_level: int = 0

Wire key requiredLegendLevel

Legendary level it needs

research_duration pydantic-field

research_duration: int = 0

Wire key researchDuration

Research time in seconds

outer_realms_research_duration pydantic-field

outer_realms_research_duration: int = 0

Wire key globalServerResearchDuration

Research time on the Outer Realms

only_with_research_expert pydantic-field

only_with_research_expert: bool = False

Wire key onlyWithResearchExpert

It needs the research expert

cost_rubies pydantic-field

cost_rubies: int = 0

Wire key costC2

Rubies it costs

costs pydantic-field

costs: tuple[Collectable, ...] = ()

What it costs, in the items' order: resources, coins, rubies, tokens, ...

outer_realms_costs pydantic-field

outer_realms_costs: tuple[Collectable, ...] = ()

What it costs on the Outer Realms

EventDef pydantic-model

Bases: _Row

An event: who sees it and where.

Client: ASpecialEventVO.parseBasicsFromXmlNode (bundle lines 2959-2974); a season event's own map is the first of mapID (ASeasonEventVO.parseEventXmlNode, bundle line 31385); a shop's packages are packageIDs (BuyPackagesEventVO.parseEventXmlNode, split.js line 33778)

Fields:

Validators:

event_id pydantic-field

event_id: GameDataId['Event']

Wire key eventID

The event

event_type pydantic-field

event_type: str = ''

Wire key eventType

Event type, e.g. NomadInvasion

min_level pydantic-field

min_level: int = 0

Wire key minLevel

Lowest player level that sees it

max_level pydantic-field

max_level: int = 99

Wire key maxLevel

Highest player level that sees it

open_with_login pydantic-field

open_with_login: bool = False

Wire key openWithLogin

Its dialog opens on login

sort_order pydantic-field

sort_order: int = 0

Wire key sortOrder

Order among the events

crossplay_min_level pydantic-field

crossplay_min_level: int = -1

Wire key crossplayMinLevel

Lowest level on a crossplay server; -1 for none

extension_unlock pydantic-field

extension_unlock: int = 0

Wire key eventExtensionUnlock

Its extension unlock

kingdoms pydantic-field

kingdoms: tuple[GameDataId[Kingdom], ...] = (Kingdom.GREEN,)

Wire key kIDs

The kingdoms it runs in

area_types pydantic-field

area_types: tuple[GameDataId[MapItemType], ...] = (MapItemType.CASTLE,)

Wire key areaTypes

The castle types it counts in

map_ids pydantic-field

map_ids: tuple[GameDataId['TreasureMapId'], ...] = ()

Wire key mapID

The treasure maps it runs on, e.g. a season event's, whose first is its own map

package_ids pydantic-field

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

Wire key packageIDs

The packages its shop sells, for an event with a shop, before those the server adds

LootBoxDef pydantic-model

Bases: _Row

A loot box.

Client: LootBoxVO.parseXML (bundle line 112502)

Fields:

Validators:

loot_box_id pydantic-field

loot_box_id: GameDataId['LootBox']

Wire key lootBoxID

The loot box

name pydantic-field

name: str = ''

Internal name, e.g. MysteryBoxBronze

loot_box_type_id pydantic-field

loot_box_type_id: GameDataId['LootBoxType'] = 0

Wire key lootBoxTypeID

Its type

tombola_id pydantic-field

tombola_id: int = 0

Wire key lootBoxTombolaID

The tombola it draws from

key_tombola_id pydantic-field

key_tombola_id: int = 0

Wire key lootBoxKeyTombolaID

The tombola its keys draw from

rarity pydantic-field

rarity: int = 0

Rarity

draws pydantic-field

draws: int = 0

Draws per opening

sort_order pydantic-field

sort_order: int = 0

Wire key sortOrder

Order among the loot boxes

LootBoxTypeDef pydantic-model

Bases: _Row

A loot box type, whose keys count toward a free box.

Client: LootBoxTypeVO.parseXML (bundle line 58900)

Fields:

Validators:

loot_box_type_id pydantic-field

loot_box_type_id: GameDataId['LootBoxType']

Wire key lootBoxTypeID

The loot box type

theme pydantic-field

theme: str = ''

Wire key lootBoxTheme

Its theme, e.g. MysteryBox

key_payout_threshold pydantic-field

key_payout_threshold: int = 0

Wire key lootBoxKeyPayoutThreshold

Keys that pay out a box

GeneralRarityDef pydantic-model

Bases: _Row

A general rarity: the shards that unlock a general of it and raise its stars, and the xp of each level.

Client: GeneralRarityXmlVO.fillFromParamXml (bundle line 113254), keyed by generalRarityID in GeneralsData (bundle line 113035)

Fields:

Validators:

rarity_id pydantic-field

rarity_id: GameDataId['GeneralRarity']

Wire key generalRarityID

The rarity

name pydantic-field

name: str = ''

Internal name, e.g. legendary

max_star_level pydantic-field

max_star_level: int = 0

Wire key maxStarLevel

The highest star level

unlock_cost pydantic-field

unlock_cost: int = 0

Wire key unlockCosts

Shards that unlock a general

upgrade_costs pydantic-field

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

Wire key upgradeCosts

Shards that raise a general from each star level

xp_requirements pydantic-field

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

Wire key xpRequirements

The total xp each level starts at

universal_shards_per_hundred pydantic-field

universal_shards_per_hundred: int = 0

Wire key universalShardsPerHundred

Universal shards per hundred shards

star_upgrade_cost

star_upgrade_cost(star_level: int) -> int

Shards that raise a general from star_level; 0 past the last, where the client offers none.

Client: GeneralRarityXmlVO.getRequiredShards (bundle line 113278)

level_for_xp

level_for_xp(xp: int) -> int

The level a general of this rarity has at xp; past the last requirement, the number of requirements.

Client: GeneralRarityXmlVO.getLevelForXP (bundle line 113274)

GeneralsHubCharacterDef pydantic-model

Bases: _Row

A character of the generals hub's inn, who spins a tombola for an offering.

Client: GeneralsHubQuestVO.fillFromParamXml (bundle line 47005), keyed by characterID in GeneralsData (bundle line 113011)

Fields:

Validators:

character_id pydantic-field

character_id: GameDataId['GeneralsHubCharacter']

Wire key characterID

The character

name pydantic-field

name: str = ''

Internal name, e.g. fatKing

cooldown_seconds pydantic-field

cooldown_seconds: int = 0

Wire key coolDownInSeconds

Seconds from the last free spin to the next

max_free_openings pydantic-field

max_free_openings: int = 0

Wire key maxFreeOpenings

Free spins that can wait at once

offering_currency_ids pydantic-field

offering_currency_ids: tuple[GameDataId['CurrencyId'], ...] = ()

Wire key tombolas

The offerings its tombolas take, one per tombola

GemColorDef pydantic-model

Bases: _Row

A gem colour, by which the auto-sell rules sell gems.

Client: GemColorVO.parseXml (bundle line 144489), read by CastleGemData.parseGemColors (bundle line 144298)

Fields:

Validators:

color_id pydantic-field

color_id: GameDataId['GemColor']

Wire key gemColorID

The gem colour

color_code pydantic-field

color_code: str = ''

Wire key colorCode

Its colour, e.g. 0x29ABE2

EquipmentGroupDef pydantic-model

Bases: _Row

An equipment item group, as equipment effects name them.

Client: XmlEquipmentGroupVO.parseXml (bundle line 144187)

Fields:

Validators:

group_id pydantic-field

group_id: GameDataId['EquipmentGroup']

Wire key itemGroupID

The item group

name pydantic-field

name: str = ''

Internal name, e.g. AttackPVP

wearer_id pydantic-field

wearer_id: GameDataId[WearerType] = -1

Wire key wearerID

Who wears it; -1 for any

slot_id pydantic-field

slot_id: GameDataId[EquipmentSlot] = -1

Wire key slotID

The slot it goes in

pic_id pydantic-field

pic_id: int = -1

Wire key picID

Its picture

drop_rate pydantic-field

drop_rate: int = -1

Wire key dropRate

Its drop rate

DifficultyTypeDef pydantic-model

Bases: _Row

An event difficulty type, e.g. easyPlus.

Client: EventAutoScalingDifficultyTypeVO.parseXML (bundle line 38258)

Fields:

Validators:

difficulty_type_id pydantic-field

difficulty_type_id: GameDataId['DifficultyType']

Wire key difficultyTypeID

The type

name pydantic-field

name: str = ''

Internal name, e.g. easyPlus

sort_order pydantic-field

sort_order: int = 0

Wire key sortOrder

Order among the types

QuestCondition pydantic-model

Bases: _Row

One thing a quest counts: a type+amount+data part of its conditions.

Client: ABasicQuestConditionVO.loadFromParamArray (bundle line 52833)

Fields:

condition_type pydantic-field

What it counts, e.g. buyRubies

amount pydantic-field

amount: int = 0

How many it needs

raw_data pydantic-field

raw_data: str = ''

Its |-separated parameters, which mean something different for each type

parse_list classmethod

parse_list(value: object) -> list[QuestCondition] | object

Each #-separated condition of a conditions column; an empty part is left out.

Client: CastleQuestVO.parseConditions (bundle line 52467), DailyQuestVO.fillFromParamXML (bundle line 134125)

QuestDef pydantic-model

Bases: _Row

A quest: where it shows, what unlocks it and what it counts.

Client: CastleQuestVO.fillFromParamXML (bundle lines 52452-52454)

Fields:

Validators:

quest_id pydantic-field

quest_id: GameDataId['QuestId']

Wire key questID

The quest

series_id pydantic-field

series_id: int = -1

Wire key questSeriesID

The quest series; -1 for none

series_number pydantic-field

series_number: int = 1

Wire key questSeriesNumber

Its place in the series

quests_in_series pydantic-field

quests_in_series: int = 0

Wire key numberOfQuestsInSeries

Quests in the series

shown_kingdom pydantic-field

shown_kingdom: GameDataId[Kingdom] = Kingdom.GREEN

Wire key shownKingdomID

The kingdom it is shown in

trigger_kingdom pydantic-field

trigger_kingdom: GameDataId[Kingdom] = Kingdom.GREEN

Wire key triggerKingdomID

The kingdom it counts in, as the row has it

hidden pydantic-field

hidden: bool = False

It is not shown

map_id pydantic-field

map_id: GameDataId['TreasureMapId'] = -1

Wire key mapID

The season event map it belongs to; -1 for none

required_level pydantic-field

required_level: int = 0

Wire key requiredLevel

Player level it needs

required_legendary_level pydantic-field

required_legendary_level: int = 0

Wire key requiredLegendLevel

Legendary level it needs

required_quest_id pydantic-field

required_quest_id: GameDataId['QuestId'] = -1

Wire key requiredQuestID

The quest it needs first; -1 for none

quest_giver_id pydantic-field

quest_giver_id: int = 0

Wire key questGiverID

The character who gives it

event_id pydantic-field

event_id: GameDataId['Event'] = 0

Wire key eventID

The event it belongs to; 0 for none

duration pydantic-field

duration: int = -1

Seconds it runs; -1 for no limit

objective_type pydantic-field

objective_type: int = 0

Wire key objectiveType

Its objective type

auto_show pydantic-field

auto_show: bool = False

Wire key autoShow

It opens on its own

sort_priority pydantic-field

sort_priority: int | None = None

Wire key sortPriority

Order in the quest book; None sorts last

cost_rubies pydantic-field

cost_rubies: int = 0

Wire key c2Cost

Rubies to finish it at once

questbook_tab_id pydantic-field

questbook_tab_id: int = -1

Wire key questbookTabID

Its quest book tab; -1 for none

conditions pydantic-field

conditions: tuple[QuestCondition, ...] = ()

What it counts

DailyQuestDef pydantic-model

Bases: _Row

A daily quest.

Client: DailyQuestVO.fillFromParamXML (bundle lines 134124-134131)

Fields:

Validators:

quest_id pydantic-field

quest_id: GameDataId['DailyQuestId']

Wire key dailyQuestID

The daily quest

trigger_kingdom pydantic-field

trigger_kingdom: GameDataId[Kingdom] = Kingdom.GREEN

Wire key triggerKingdomID

The kingdom it counts in; -1 for any

is_outer_realms_quest pydantic-field

is_outer_realms_quest: bool = False

Wire key isTempServerQuest

It runs on the Outer Realms

daily_task_points pydantic-field

daily_task_points: int = 0

Wire key addDailyDutyPoints

Daily task points it gives

level_calculated pydantic-field

level_calculated: bool = False

Wire key levelCalculated

Its amounts scale with the player's level

conditions pydantic-field

conditions: tuple[QuestCondition, ...] = ()

What it counts

TitleDef pydantic-model

Bases: EffectSpecRow

A title of the glory, Berimond or Storm Islands title systems.

Client: TitleVO.parseXml (bundle lines 62705-62713)

Fields:

Validators:

title_id pydantic-field

title_id: GameDataId['Title']

Wire key titleID

The title

title_system pydantic-field

title_system: GameDataKey[TitleSystem] = '-1'

Wire key type

Its title system

threshold pydantic-field

threshold: int = -1

Points from which it is held; -1 for a top-X title

display_type pydantic-field

display_type: GameDataKey[TitleDisplayType] = '-1'

Wire key displayType

Whether it goes before or after the name

forced pydantic-field

forced: bool = False

It is a forced title

decay pydantic-field

decay: int = -1

Its point decay

is_positive pydantic-field

is_positive: bool = False

Wire key isPositive

It is a positive title

top_x pydantic-field

top_x: int = -1

Wire key topX

The top ranks that hold it; -1 or 0 for a points title

previous_title_id pydantic-field

previous_title_id: GameDataId['Title'] = -1

Wire key previousTitleID

The title below it in its system; -1 for the first

reward_id pydantic-field

reward_id: RewardId = RewardId(-1)

Wire key rewardID

Its reward, whose collectables GameData.reward_list gives; -1 for none

might_value pydantic-field

might_value: int = -1

Wire key mightValue

Might points it gives

rewards

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

What holding the title gives; nothing when it has no reward.

Client: CastleTitleSystemHelper.getTitleRewardText reads getListById(rewardID) when it is above -1 (bundle line 4444)

AchievementCondition pydantic-model

Bases: _Row

One thing an achievement counts: a type+amount+params part of its conditions.

Client: AchievementConditionVO (bundle line 92956)

Fields:

condition_type pydantic-field

condition_type: str

What it counts, e.g. achievementPoints

amount pydantic-field

amount: int = 0

How many it needs

params pydantic-field

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

Its further parameters, which differ for each type

parse_list classmethod

parse_list(value: object) -> list[AchievementCondition] | object

Each #-separated condition of a conditions column; an empty part is left out.

Client: AchievementVO.fillFromParamXML (bundle lines 92883-92887)

AchievementDef pydantic-model

Bases: _Row

One step of an achievement series.

Client: AchievementVO.fillFromParamXML (bundle lines 92882-92887) and AchievementSerieVO.fillFromParamXML (bundle line 92817), grouped by series in CastleAchievementData (bundle lines 29820-29827)

Fields:

Validators:

achievement_id pydantic-field

achievement_id: GameDataId['Achievement']

Wire key achievementID

The achievement

series_id pydantic-field

series_id: int = 0

Wire key achievementSeriesID

The series it is a step of

series_number pydantic-field

series_number: int = 0

Wire key achievementSeriesNumber

Its step in the series

achievements_in_series pydantic-field

achievements_in_series: int = 0

Wire key numberOfAchievementsInSeries

Steps in the series

required_achievement_id pydantic-field

required_achievement_id: GameDataId['Achievement'] = 0

Wire key requiredAchievementID

The step before it; -1 or 0 for none

achievement_points pydantic-field

achievement_points: int = 0

Wire key achievementPoints

Achievement points it gives

category pydantic-field

category: str = ''

The series' category, e.g. achievement or event

conditions pydantic-field

conditions: tuple[AchievementCondition, ...] = ()

What it counts

AllianceCrestColorDef pydantic-model

Bases: _Row

A colour an alliance crest can use.

Client: AllianceCrestColorVO.parseXML (bundle line 111012), keyed by id in CastleAllianceCrestData.parseXML (bundle lines 110965-110970)

Fields:

Validators:

color_id pydantic-field

color_id: GameDataId['AllianceCrestColor']

Wire key allianceCoatColorID

The colour

color pydantic-field

color: str = ''

The colour as hex text, e.g. 0xDBDACA

AllianceCrestLayoutDef pydantic-model

Bases: EffectSpecRow

A layout an alliance crest can use, and the bonuses it grants.

Client: AllianceCrestLayoutVO.parseXML and parseEffects (bundle lines 111024-111032), keyed by id in CastleAllianceCrestData.parseXML (bundle lines 110958-110963)

Fields:

Validators:

layout_id pydantic-field

layout_id: GameDataId['AllianceCrestLayout']

Wire key allianceCoatLayoutID

The layout

color_count pydantic-field

color_count: int = 0

Wire key noofColors

Colours it takes

event_id pydantic-field

event_id: GameDataId['Event'] = 0

Wire key eventID

The event that awards it; 0 for none

max_duration pydantic-field

max_duration: int = 0

Wire key maxDuration

Seconds it is held once won; 0 for a layout that does not expire

effect_icon_id pydantic-field

effect_icon_id: int = 0

Wire key effectIconID

The icon its bonus shows

label pydantic-field

label: str = ''

Wire key comment1

Designer label the game does not read, e.g. nomad

ConstructionItemRecipeDef pydantic-model

Bases: _Row

A recipe that crafts a construction item, one of a blueprint's.

Client: ConstructionItemRecipeVO.parseFromXml (bundle line 141060), grouped into blueprints by ConstructionItemBlueprintData.parseFromXml (bundle line 141026)

Fields:

Validators:

recipe_id pydantic-field

Wire key constructionItemRecipeID

The recipe, as a research unlocks it

blueprint_id pydantic-field

blueprint_id: int = 0

Wire key blueprintID

The blueprint it belongs to

construction_item_id pydantic-field

construction_item_id: GameDataId['ConstructionItem'] = 0

Wire key constructionItemID

The construction item it crafts

PrebuiltCastleDef pydantic-model

Bases: _Row

A castle or camp you start a kingdom, a season event's map or a special server with, and its price.

costs are its non-zero goods cost columns: resources, coins and rubies; the client reads no other.

Client: PrebuiltCastleItemVO.parseXML and parseCosts (bundle lines 142341-142342), keyed by id and by space in PrebuiltCastleData.parsePreBuiltCastles (bundle line 142274)

Fields:

Validators:

prebuilt_castle_id pydantic-field

prebuilt_castle_id: GameDataId['PrebuiltCastle']

Wire key preBuiltCastleID

The prebuilt castle

space_ids pydantic-field

space_ids: tuple[GameDataId[Kingdom, 'TreasureMapId'], ...] = ()

Wire key spaceIDs

Where it is offered: a kingdom, or a season event's map; Kingdom.GREEN for a special server's

min_level pydantic-field

min_level: int = 0

Wire key minLevel

Player level it needs

shown_discount pydantic-field

shown_discount: int = 0

Wire key shownDiscount

The discount in percent its offer shows

is_main_castle_copy pydantic-field

is_main_castle_copy: bool = False

Wire key isMainCastleCopy

It copies your main castle's buildings, as the Outer Realms castle transport does

costs pydantic-field

costs: tuple[Collectable, ...] = ()

What it costs; empty for a free one

area_label pydantic-field

area_label: str = ''

Wire key comment1

Designer label the game does not read, e.g. Underworld

label pydantic-field

label: str = ''

Wire key comment2

Designer label the game does not read, e.g. C2Camp

cost_rubies property

cost_rubies: int

The rubies among its costs; 0 when it costs none.

is_free property

is_free: bool

Whether it costs nothing. Client: PrebuiltCastleItemVO.isFree (bundle line 142353)

is_premium property

is_premium: bool

Whether rubies are its only price. Client: PrebuiltCastleItemVO.isPremium (bundle line 142354)

primary_costs property

primary_costs: tuple[Collectable, ...]

What it costs bought without its ruby price: all of a premium castle's costs, else those but the rubies.

Client: PrebuiltCastleItemVO.primaryCosts (bundle line 142357)

kingdom property

kingdom: Kingdom | None

The kingdom it starts, the first of its spaces that is one; None for a season camp.

Client: AUnlockPrebuiltCastle.buyPrebuiltCastle (bundle line 55479) unlocks a kingdom for a castle with a space in WorldConst.WORLD_IDS

SpecialServerPrebuiltCastleDef pydantic-model

Bases: _Row

A prebuilt castle as a special server's castle selection offers it: the Outer Realms, Beyond the Horizon or the Storm Islands, each with a table of its own.

costs are its cost columns, rubies or castle passage tokens; selection_costs is what the selection charges. The questsToFinish column is not read: the client reads it nowhere.

Client: SpecialServerPreBuiltCastleVO.parseXML (bundle line 40289), keyed by id in CastleTempServerData (bundle line 140201), CastleAllianceBattleGroundData (bundle line 144847) and CastleKingdomData (bundle line 134581)

Fields:

Validators:

prebuilt_castle_id pydantic-field

prebuilt_castle_id: GameDataId['PrebuiltCastle']

Wire key preBuiltCastleID

The prebuilt castle

start_resources_id pydantic-field

start_resources_id: StartResourcesId = StartResourcesId(0)

Wire key startResourceID

The resources you start with

start_level pydantic-field

start_level: int = 0

Wire key startPlayerLevel

Your level there

start_legendary_level pydantic-field

start_legendary_level: int = 0

Wire key startPlayerLegendLevel

Your legendary level there; 0 for none

passage_token_package_id pydantic-field

passage_token_package_id: PackageId = PackageId(0)

Wire key castlePassageTokenPackageID

The package that sells the castle passage tokens it costs; 0 for none

costs pydantic-field

costs: tuple[Collectable, ...] = ()

What it costs; empty when the row names none

selection_costs

selection_costs(castle: PrebuiltCastleDef) -> tuple[Collectable, ...]

What the castle selection charges for it: its own costs; with none, the castle's primary costs, or else 0 rubies, which the client keeps as the price of a free castle.

Client: SpecialServerPreBuiltCastleVO.parseXML (bundle line 40289) with CollectableParserX2CEventPackages.createCostList (bundle line 62852)

is_ruby_castle

is_ruby_castle(castle: PrebuiltCastleDef) -> bool

Whether its selection is sent as bought with rubies (OC2): its selection costs hold rubies, even the 0 rubies of a free castle.

Client: CastleSpecialServerPreBuildCastleSelectionDialog.onConfirmed (bundle line 27954), CollectableList.containsType (bundle line 1830)

cost_rubies

cost_rubies(castle: PrebuiltCastleDef) -> int

The rubies its selection costs; 0 when it costs none.

StartResourcesDef pydantic-model

Bases: _Row

The goods a special server's prebuilt castle starts with.

Client: StartResourcesVO.parseXML (bundle line 145059), keyed by id in CastleAllianceBattleGroundData (bundle line 144845)

Fields:

Validators:

start_resources_id pydantic-field

start_resources_id: StartResourcesId

Wire key startResourceID

The start resources

resources pydantic-field

resources: tuple[Collectable, ...] = ()

What you start with

PrivateVillageDef pydantic-model

Bases: EffectSpecRow

One level of a private resource village, bought with resource village tokens.

Client: PrivateResourceVillageInfoVO.fillFromParamXML (bundle line 143715), keyed by id in CastlePrivateResourceVillageData.parse (bundle line 143686)

Fields:

Validators:

village_type_id pydantic-field

village_type_id: GameDataId['PrivateVillageType']

Wire key villageID

The village type and level

resource pydantic-field

resource: str = ''

Wire key type

What it produces: wood, stone or food

level pydantic-field

level: int = 0

Wire key villageLevel

Village level

kingdom pydantic-field

kingdom: GameDataId[Kingdom] = Kingdom.GREEN

Wire key kID

Its kingdom

token_cost pydantic-field

token_cost: int = 0

Wire key costResourceVillageTokenLevel

Resource village tokens this level costs

total_token_cost pydantic-field

total_token_cost: int = 0

Wire key costResourceVillageToken

Resource village tokens it costs up to this level

CraftingRecipeDef pydantic-model

Bases: _Row

A recipe a crafting queue crafts.

The table keeps every row; the client, when it loads the table, drops a recipe whose rewards give nothing.

Client: CraftingRecipeVO.fillFromParamXml (bundle line 111526), kept by id in CastleCraftingData (bundle line 111386) only when its output is not empty

Fields:

Validators:

recipe_id pydantic-field

recipe_id: CraftingRecipeId

Wire key craftingRecipeId

The recipe

queue_id pydantic-field

Wire key queueTypeId

The crafting queue it is crafted in

recipe_group_id pydantic-field

recipe_group_id: int = 0

Wire key recipeGroupID

The group the recipe's levels share

research_group_id pydantic-field

research_group_id: int = 0

Wire key researchGroupID

The research group that unlocks it; 0 for none

level pydantic-field

level: int = 0

Recipe level

recipe_type pydantic-field

recipe_type: str = ''

Wire key type

short, long or ruby

crafting_seconds pydantic-field

crafting_seconds: int = 0

Wire key craftingDuration

Seconds it crafts

skip_cost_rubies pydantic-field

skip_cost_rubies: int = 0

Wire key skipCostC2

Rubies that finish it

costs pydantic-field

costs: tuple[Collectable, ...] = ()

What it costs to start

reward_ids pydantic-field

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

Wire key rewardIDs

What it crafts

required_buildings pydantic-field

required_buildings: tuple[GameDataId['Building'], ...] = ()

Wire key requiredCraftingBuildings

The buildings it needs

CraftingQueueDef pydantic-model

Bases: _Row

A crafting queue's slots: those it always has, and the temporary ones coins unlock for a while.

Client: CraftingQueueXML.fillFromParamXml (bundle line 111498), keyed by queueTypeId in CastleCraftingData (bundle line 111381), the CQID a queue is sent with

Fields:

Validators:

queue_id pydantic-field

queue_id: CraftingQueueId

Wire key queueTypeId

The crafting queue

permanent_production_slots pydantic-field

permanent_production_slots: int = 0

Wire key permanentProductionSlots

Slots that always craft

production_slot_unlock_coins pydantic-field

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

Wire key productionSlotUnlockCostC1

Coins each temporary crafting slot unlocks for, one per slot

production_slot_unlock_seconds pydantic-field

production_slot_unlock_seconds: int = 0

Wire key productionSlotUnlockDuration

Seconds a temporary crafting slot stays unlocked

permanent_queue_slots pydantic-field

permanent_queue_slots: int = 0

Wire key permanentQueueSlots

Waiting slots it always has

queue_slot_unlock_coins pydantic-field

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

Wire key queueSlotUnlockCostC1

Coins each temporary waiting slot unlocks for, one per slot

queue_slot_unlock_seconds pydantic-field

queue_slot_unlock_seconds: int = 0

Wire key queueSlotUnlockDuration

Seconds a temporary waiting slot stays unlocked

FusionSystemDef pydantic-model

Bases: _Row

A fusion forge's energy and fusion rules.

The client builds one forge per row, with the row's id (FusionForgeData.init, bundle line 141977), and looks both tables up by that id (FusionConst.DECORATION_FORGE_ID, bundle lines 24974, 78008, 78074).

Client: XmlFusionSystemVO.parseXml (bundle line 142170)

Fields:

Validators:

forge_id pydantic-field

forge_id: GameDataId['FusionForgeId']

Wire key id

The fusion forge

energy_recharge_seconds pydantic-field

energy_recharge_seconds: int = 0

Wire key energyRechargeIntervalInSeconds

Seconds between energy recharges

assemble_catalyst_energy pydantic-field

assemble_catalyst_energy: int = 0

Wire key assembleCatalystEnergyCost

Energy one assembled catalyst takes

disassemble_catalyst_energy pydantic-field

disassemble_catalyst_energy: int = 0

Wire key disassembleCatalystEnergyCost

Energy one disassembled catalyst takes

base_bonus_xp_chance pydantic-field

base_bonus_xp_chance: int = 0

Wire key baseBonusFusionXPChance

Percent chance of bonus fusion XP

premium_bonus_xp_chance pydantic-field

premium_bonus_xp_chance: int = 0

Wire key premiumBonusFusionXPChance

Percent chance of bonus fusion XP with a premium catalyst

refill_cost_rubies pydantic-field

refill_cost_rubies: int = 0

Wire key skipRechargeHardCurrencyCost

Rubies the first energy refill costs

refill_cost_factor pydantic-field

refill_cost_factor: float = 0.0

Wire key skipRechargeHardCurrencyCostFactor

What each refill bought multiplies the next one's price by

FusionForgeDef pydantic-model

Bases: _Row

A fusion forge's dust and daily minute skips.

Client: XmlFusionForgeVO.parseXml (bundle line 142155)

Fields:

Validators:

forge_id pydantic-field

forge_id: GameDataId['FusionForgeId']

Wire key forgeID

The fusion forge

dust_currency_id pydantic-field

dust_currency_id: GameDataId['CurrencyId'] = 0

Wire key dustCurrencyID

The dust its fusions and level-ups spend

minute_skips_per_day pydantic-field

minute_skips_per_day: int = 0

Wire key usableMinuteSkipsPerDay

Minute skips it takes a day

JudgementDef pydantic-model

Bases: _Row

A citizen judgement: where it appears, and what each verdict asks and gives.

The requirements and rewards are the kinds of goods the client looks up, e.g. units or wood.

Client: JudgementVO.fillFromParamXML (bundle line 134514), keyed by id in CastleJudgementData (bundle line 134451)

Fields:

Validators:

judgement_id pydantic-field

judgement_id: GameDataId['Judgement']

Wire key judgementID

The judgement

visual_name pydantic-field

visual_name: str = ''

Wire key visualName

The figure it shows, e.g. wolfs

spawn_spot pydantic-field

spawn_spot: str = ''

Wire key spawnSpot

Where it appears, e.g. keep

option_a_requirements pydantic-field

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

Wire key conditionTypeA

What verdict A asks for

option_b_requirements pydantic-field

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

Wire key conditionTypeB

What verdict B asks for

option_a_rewards pydantic-field

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

Wire key rewardTypeA

What verdict A gives

option_b_rewards pydantic-field

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

Wire key rewardTypeB

What verdict B gives

CoatOfArmsSymbolDef pydantic-model

Bases: _Row

A symbol for a coat of arms. One with a required achievement is a premium symbol: that achievement earns it, and it is unlocked for its coin or ruby price.

Client: CastleCrestSymbolData.parseXML (bundle line 111588), PremiumCrestSymbolVO.parseXML (bundle line 111660)

Fields:

Validators:

symbol_id pydantic-field

symbol_id: CoatOfArmsSymbolId

Wire key crestSymbolID

The symbol, as a coat of arms names it

required_achievement_id pydantic-field

required_achievement_id: GameDataId['Achievement'] = 0

Wire key requiredAchievementID

The achievement that earns it; 0 for a standard symbol, free to use

cost_coins pydantic-field

cost_coins: int = 0

Wire key costC1

Coins it is unlocked for

cost_rubies pydantic-field

cost_rubies: int = 0

Wire key costC2

Rubies it is unlocked for

is_premium property

is_premium: bool

Whether an achievement earns it and it must be unlocked.

PackageDef pydantic-model

Bases: _Row

An event package: what a shop sells for a fixed price, and what a gift package holds.

costs are its price before discounts, in the order the client shows it, and rewards what it gives; a bundle's rewards add up those of the packages it names (GameData.packages passes their rows in).

Client: EventPackageVO.fillFromParamXML (split.js line 177696), read by CastleEventPackageData.parseXml (split.js line 670335), which reads a bundle's rewards again once every package is read

Fields:

Validators:

package_id pydantic-field

package_id: PackageId

Wire key packageID

The package

package_type pydantic-field

package_type: str = '0'

Wire key packageType

What it holds, e.g. tool, currency or item

is_gift_package pydantic-field

is_gift_package: bool = False

Wire key isGiftPackage

Whether it is a gift package you may send

costs pydantic-field

costs: tuple[Collectable, ...] = ()

Its price before discounts

rewards pydantic-field

rewards: tuple[Collectable, ...] = ()

What it gives

min_level pydantic-field

min_level: int = 0

Wire key minLevel

Lowest player level it is shown to

max_level pydantic-field

max_level: int = 99

Wire key maxLevel

Highest player level it is shown to

min_legend_level pydantic-field

min_legend_level: int = 0

Wire key minLegendLevel

Lowest legendary level it is shown to

max_legend_level pydantic-field

max_legend_level: int = _LEGEND_LEVEL_CAP

Wire key maxLegendLevel

Highest legendary level it is shown to

sort_order pydantic-field

sort_order: float = 0.0

Wire key sortOrder

Its place in a shop

stock pydantic-field

stock: int = -1

Wire key stock

How many you may buy in all; 0 or less for no limit

not_rebuyable pydantic-field

not_rebuyable: bool = False

Wire key notRebuyable

Whether you may buy it only once

fill_up_resource_storage pydantic-field

fill_up_resource_storage: bool = False

Wire key fillUpResourceStorage

Whether it fills the castle's storage, priced by the free space

fill_all_storages pydantic-field

fill_all_storages: bool = False

Wire key fillAllStorages

Whether it fills the storages of all your kingdoms, at a price the server names

is_banner_package pydantic-field

is_banner_package: bool = False

Wire key isBannerPackage

Whether a shop shows it as its banner

max_buy_per_click pydantic-field

max_buy_per_click: int = _MAX_BUY_PER_CLICK

Wire key maxBuyPerClick

Most you may buy at once of a package without a stock

bundle_package_ids pydantic-field

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

Wire key packageIDs

The packages a bundle gives

has_custom_price property

has_custom_price: bool

Whether its price depends on your storages, so the client names it when buying.

Client: EventPackageVO.hasCustomPrice (split.js line 178359)

is_stock_limited property

is_stock_limited: bool

Whether you may buy it only so often: once, or up to its stock.

Client: EventPackageVO.isStockLimited (split.js line 177877)

shown_reward property

shown_reward: Collectable | None

The reward a shop shows for it: its one reward, or None where it shows the package itself, for several rewards, a random one, or more than one random equipment, hero equipment or gem.

Client: EventPackageVO.reward and usePackageIcon (split.js lines 178430, 178148)

places_building property

places_building: bool

Whether buying it places a building, so the client names the castle it goes to.

Client: AMerchantBuyDialog.onBtnOkClick (split.js line 214956) checks reward.itemType

remaining_stock

remaining_stock(bought: int = 0) -> int

How many you may still buy, having bought bought; max_buy_per_click for a package without a stock.

Client: EventPackageVO.remainingStock (split.js line 177884)

may_be_bought_in_bulk

may_be_bought_in_bulk(bought: int = 0) -> bool

Whether more than one may be bought at once, having bought bought; the client offers one only otherwise.

Client: EventPackageVO.mayBeBoughtInBulk (split.js line 178329), which shows the amount slider of CastleGenericSliderBuyDialog (split.js line 34317)

PlayerNameChangeDef pydantic-model

Bases: _Row

The ruby price of one of your player name changes, by its number.

Client: ChangePlayerNameData.parseXml (bundle line 145454)

Fields:

Validators:

name_change_id pydantic-field

name_change_id: int

Wire key nameChangeID

Which name change it prices: 1 for the first

cost_rubies pydantic-field

cost_rubies: int = 0

Wire key costC2

Rubies it costs

ScalingCampDef pydantic-model

Bases: _Row

A camp of an event's difficulty scaling: the level and costs a chosen difficulty gives it.

Client: DifficultyScalingCampXmlVO.parseXML (bundle line 145227), keyed by id in CastleEventDifficultyScalingData (bundle line 145211)

Fields:

Validators:

scaling_camp_id pydantic-field

scaling_camp_id: ScalingCampId

Wire key eventAutoScalingCampID

The scaling camp, as map rows name it

rank pydantic-field

rank: int = 0

Its rank

level pydantic-field

level: int = 0

Wire key camplevel

The camp level it gives

cool_down pydantic-field

cool_down: int = 0

Wire key coolDown

Cooldown in seconds after an attack

event_id pydantic-field

event_id: GameDataId['Event'] = 0

Wire key eventID

The event it belongs to

cooldown_increase pydantic-field

cooldown_increase: int = 0

Wire key cooldownIncrease

Cooldown added per attack

cooldown_increase_cap pydantic-field

cooldown_increase_cap: int = 0

Wire key cooldownIncreaseCap

Most cooldown added

skip_cost pydantic-field

skip_cost: int = 0

Wire key skipCosts

Cost to skip the cooldown

skip_cost_increase pydantic-field

skip_cost_increase: int = 0

Wire key skipCostIncrease

Skip cost added per attack

skip_cost_increase_cap pydantic-field

skip_cost_increase_cap: int = 0

Wire key skipCostIncreaseCap

Most skip cost added

wall_bonus pydantic-field

wall_bonus: int = 0

Wire key wallBonus

Wall protection, in percent

gate_bonus pydantic-field

gate_bonus: int = 0

Wire key gateBonus

Gate protection, in percent

moat_bonus pydantic-field

moat_bonus: int = 0

Wire key moatBonus

Moat protection, in percent

unit_capacity pydantic-field

unit_capacity: int = 0

Wire key unitCapacity

Units it holds

shogun_points_needed_for_level_up pydantic-field

shogun_points_needed_for_level_up: int = -1

Wire key shogunPointsNeededForLevelUp

Shogun points to the next level; -1 for none

player_rage_cap pydantic-field

player_rage_cap: int = -1

Wire key playerRageCap

Most rage a player builds; -1 for none

rage_needed_for_level_up pydantic-field

rage_needed_for_level_up: int = -1

Wire key rageNeededForLevelUp

Rage to the next level; -1 for none

normal_def_strength_boost_min pydantic-field

normal_def_strength_boost_min: int = 0

Wire key normalDiffDefStrengthBoostMinDefense

Least defence boost, normal difficulty

normal_def_strength_boost_max pydantic-field

normal_def_strength_boost_max: int = 0

Wire key normalDiffDefStrengthBoostMaxDefense

Most defence boost, normal difficulty

premium_def_strength_boost_min pydantic-field

premium_def_strength_boost_min: int = 0

Wire key premiumDiffDefStrengthBoostMinDefense

Least defence boost, premium difficulty

premium_def_strength_boost_max pydantic-field

premium_def_strength_boost_max: int = 0

Wire key premiumDiffDefStrengthBoostMaxDefense

Most defence boost, premium difficulty

DaimyoContractDef pydantic-model

Bases: _Row

An alliance contract of the daimyo event: one level of a contract rank.

The contracts of one rank, in the table's order, are that rank's levels.

Client: XmlSamuraiDaimyoContractVO.parseXml (bundle line 66377), keyed by id in SamuraiDaimyoDataXml.parseXml (bundle line 13914)

Fields:

Validators:

contract_id pydantic-field

contract_id: DaimyoContractId

Wire key id

The contract

rank pydantic-field

rank: int = -1

The contract rank it is a level of

enable_on_start pydantic-field

enable_on_start: bool = False

Wire key enableOnStart

Open from the event's start, not after another contract

next_contract_id pydantic-field

next_contract_id: DaimyoContractId = DaimyoContractId(-1)

Wire key nextContract

The contract after it; -1 for none

shogun_points pydantic-field

shogun_points: int = -1

Wire key shogunPoints

Shogun points it takes

war_effort_points pydantic-field

war_effort_points: int = -1

Wire key warEffortPoints

War effort points it gives

RewardDef pydantic-model

Bases: _Row

One reward of the items: what it gives, and to whom.

collectables reads every collectable column of the row (see Collectable.from_reward_row), each add<currency name> column by the currency names GameData passes in as validation context (currency_ids); read without them, such a column is kept as OTHER.

Client: RewardVO.fillFromParamXml (bundle line 142368), read from the rewards table by CastleRewardData.parseXml (bundle line 142323)

Fields:

Validators:

reward_id pydantic-field

reward_id: RewardId

Wire key rewardID

The reward

grant_type pydantic-field

Wire key grantType

Who it goes to

collectables pydantic-field

collectables: tuple[Collectable, ...] = ()

What it gives, in the client's order

TreasureMapDef pydantic-model

Bases: _Row

A treasure map: a season event's map or one of the treasure hunt's, with its nodes and prices.

Client: TreasureMapVO.fillFromParamXML (bundle line 140567), keyed by mapID in CastleTreasureMapData.parseTreasureMapXML (bundle line 140439)

Fields:

Validators:

map_id pydantic-field

map_id: GameDataId['TreasureMapId']

Wire key mapID

The map

label pydantic-field

label: str = ''

Wire key comment1

Designer label the game does not read, e.g. hardmode

note pydantic-field

note: str = ''

Wire key comment2

Designer note the game does not read, e.g. Thornking

node_ids pydantic-field

node_ids: tuple[TreasureMapNodeId, ...] = ()

Wire key tmapnodeIDs

Its nodes, besides the start node

end_node_id pydantic-field

Wire key endNodeID

The node that ends the map

map_type pydantic-field

Wire key maptype

What the map is for

kingdom pydantic-field

kingdom: GameDataId[Kingdom] = Kingdom.GREEN

Wire key kID

The kingdom a treasure hunt's map lies in

total_pieces pydantic-field

total_pieces: int = 0

Wire key totalpieces

Pieces that make the map

piece_cost_rubies pydantic-field

piece_cost_rubies: int = 0

Wire key costpiece

Rubies a missing piece costs

travel_seconds pydantic-field

travel_seconds: int = 0

Wire key travelTime

Seconds a transfer to a season map travels

skip_cost_rubies pydantic-field

skip_cost_rubies: int = 0

Wire key skipCostC2

Rubies that skip a transfer to a season map

package_ids pydantic-field

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

Wire key packages

The packages the map's shop sells

TreasureMapNodeDef pydantic-model

Bases: _Row

A node of a treasure map: a camp, an obstacle or a port, and the nodes that unlock it.

Client: TMapNodeVO.fillFromParamXML (bundle line 26934), keyed by tmapnodeID in CastleTreasureMapData.parseTreasureMapXML (bundle line 140431)

Fields:

Validators:

node_id pydantic-field

Wire key tmapnodeID

The node

node_type pydantic-field

node_type: str = 'DUNGEON'

Wire key type

What it is, e.g. DUNGEON or BRIDGE

unlocked_by_any pydantic-field

unlocked_by_any: tuple[TreasureMapNodeId, ...] = (TreasureMapNodeId(0),)

Wire key orUnlockIDs

Any of these nodes unlocks it

unlocked_by_all pydantic-field

unlocked_by_all: tuple[TreasureMapNodeId, ...] = (TreasureMapNodeId(0),)

Wire key andUnlockIDs

All of these nodes unlock it

count_victories pydantic-field

count_victories: int = 1

Wire key countVictories

The victory count its camp is looked up by

part_price_id pydantic-field

part_price_id: PartPayPriceId | None = None

Wire key partPayPriceID

The price its obstacle is paid in parts; None for none

position pydantic-field

position: int = 0

Wire key pos

Its place on the map

dungeon_level pydantic-field

dungeon_level: int = 0

Wire key dungeonlevel

Its camp's level

cool_down pydantic-field

cool_down: int = 0

Wire key coolDown

Seconds of cooldown after an attack

wall_bonus pydantic-field

wall_bonus: int = 0

Wire key wallBonus

Wall protection, in percent

gate_bonus pydantic-field

gate_bonus: int = 0

Wire key gateBonus

Gate protection, in percent

PartPayPriceDef pydantic-model

Bases: _Row

A price paid in parts: a season map's obstacle, a treasure map node's or a slum level's.

costs reads the row's goods as a reward row's (see Collectable.from_reward_row).

Client: PartpaypriceVO.fillFromParamXml (bundle line 142257)

Fields:

Validators:

part_price_id pydantic-field

part_price_id: PartPayPriceId

Wire key partPayPriceID

The price

costs pydantic-field

costs: tuple[Collectable, ...] = ()

What it costs, in the client's order

DonationItemDef pydantic-model

Bases: _Row

What a donation event takes, and the points it gives. Its set, donation type and resource are not read.

Client: DonationItemsVO.parseXmlNode (bundle line 111715), keyed by id in CastleDonationEventData.parseXml (bundle line 58843)

Fields:

Validators:

donation_item_id pydantic-field

donation_item_id: DonationItemId

Wire key donationItemID

The item

currency_id pydantic-field

currency_id: GameDataId['CurrencyId'] = -1

Wire key currencyID

The currency donated; -1 for a resource

ratio pydantic-field

ratio: int = -1

How many of it make a point

max_point_limit pydantic-field

max_point_limit: int = -1

Wire key maxPointLimit

Most points it gives; -1 for no limit

DonationSettingDef pydantic-model

Bases: _Row

A donation event's run settings: which donation items it takes and which rewards it gives.

The items and rewards are named by set: the donationItems rows and the donationRewards rows that share the set id.

Client: DonationSettingVO.parseXmlNode (bundle line 111773), keyed by id in CastleDonationEventData.parseXml (bundle line 58833)

Fields:

Validators:

setting_id pydantic-field

setting_id: DonationSettingId

Wire key donationSettingID

The settings

item_set_id pydantic-field

item_set_id: int = -1

Wire key donationItemSetID

The set of donation items it takes

reward_set_id pydantic-field

reward_set_id: int = -1

Wire key rewardSetID

The set of rewards it gives

TrainingProgramDef pydantic-model

Bases: _Row

A training program of the officers' school: the bonus it gives against one event's targets, and its prices.

Client: OfficersSchoolEffectVO.parseXml (bundle line 144770), keyed by id in OfficersSchoolData (bundle line 144668)

Fields:

Validators:

program_id pydantic-field

program_id: TrainingProgramId

Wire key id

The program

effect_id pydantic-field

effect_id: GameDataId['Effect'] = -1

Wire key effectID

The bonus it gives

event_id pydantic-field

event_id: GameDataId['Event'] = -1

Wire key eventID

The event it is for

cost_coins pydantic-field

cost_coins: int = -1

Wire key c1Cost

Coins its first slot costs

cost_rubies pydantic-field

cost_rubies: int = -1

Wire key c2Cost

Rubies its third slot costs

EventDifficultyDef pydantic-model

Bases: _Row

A difficulty an event offers, and what unlocking a locked one costs.

Client: EventAutoScalingDifficultyVO.parseXML (bundle line 145390)

Fields:

Validators:

difficulty_id pydantic-field

difficulty_id: EventDifficultyId

Wire key difficultyID

The difficulty

event_id pydantic-field

event_id: GameDataId['Event'] = 0

Wire key eventID

The event it is for

difficulty_type pydantic-field

difficulty_type: GameDataId['DifficultyType'] = 0

Wire key difficultyTypeID

Its type, e.g. easyPlus

is_locked pydantic-field

is_locked: bool = False

Wire key isLocked

Whether it must be unlocked

unlock_rubies pydantic-field

unlock_rubies: int = 0

Wire key rentC2Cost

Rubies that unlock it

GachaDef pydantic-model

Bases: _Row

A level of a gacha event: the pulls it covers and how many one buy may make.

Client: GachaXmlVO.init (bundle line 113936), keyed by gachaID in GachaData.init (bundle line 113911)

Fields:

Validators:

gacha_id pydantic-field

gacha_id: GachaId

Wire key gachaID

The gacha level

event_id pydantic-field

event_id: GameDataId['Event'] = 0

Wire key eventID

The gacha event

level pydantic-field

level: int = 0

Wire key gachaLevel

Its level in the event

min_pulls pydantic-field

min_pulls: int = 0

Wire key minPulls

Pulls made before it starts

max_pulls pydantic-field

max_pulls: int = 0

Wire key maxPulls

Pulls made when it ends; 0 when it never does

multi_pull_max pydantic-field

multi_pull_max: int = 0

Wire key multiPullMax

Most pulls one buy makes

WheelOfFortuneRewardSetDef pydantic-model

Bases: _Row

A Wheel of Fortune jackpot set: the rewards a jackpot spin can win.

Client: LuckyWheelData.parseXml and createRewardItemsMappedToSetID (bundle lines 17571, 17583)

Fields:

Validators:

reward_set_id pydantic-field

Wire key luckyWheelRewardSetID

The jackpot set

reward_ids pydantic-field

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

Wire key rewardIDs

Its rewards

WheelOfFortuneWinClassDef pydantic-model

Bases: _Row

A Wheel of Fortune win class: the spins to the next class, the rubies a skipped spin costs, and the previews.

Client: LuckyWheelData.parseXml (bundle lines 17571-17576)

Fields:

Validators:

win_class_id pydantic-field

Wire key luckyWheelClassID

The win class

spins_to_next_class pydantic-field

spins_to_next_class: int = 0

Wire key neededSpinsForNextClass

Spins that reach the next class

rubies_per_skipped_spin pydantic-field

rubies_per_skipped_spin: float = 0.0

Wire key C2PerSkippedSpin

Rubies each spin skipped to the next class costs

preview_reward_ids pydantic-field

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

Wire key normalPreview

The rewards the wheel previews

pro_mode_preview_reward_ids pydantic-field

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

Wire key hardcorePreview

The rewards the pro mode previews

OuterRealmsSettingDef pydantic-model

Bases: _Row

An Outer Realms run's settings. Only some columns are read: the presets and rewards are not.

Client: TempServerConfigurationVO.parseXML (bundle line 14448), keyed by settingID in CastleTempServerData (bundle line 140189)

Fields:

Validators:

setting_id pydantic-field

Wire key settingID

The settings

peace_mode pydantic-field

peace_mode: bool = False

Wire key peaceMode

Whether the run is peaceful

scoring_system pydantic-field

scoring_system: str = '0'

Wire key scoringSystem

How it scores, e.g. might

start_currency_amount pydantic-field

start_currency_amount: int = -1

Wire key startCurrencyAmount

The currency you start with; -1 for none

currency_id pydantic-field

currency_id: GameDataId['CurrencyId'] = 0

Wire key currencyID

The run's currency; 0 for none

booster_package_id pydantic-field

booster_package_id: PackageId = PackageId(0)

Wire key boosterCurrencyPackageID

The package that sells its booster currency; 0 for none

HorizonSettingDef pydantic-model

Bases: _Row

A Beyond the Horizon run's settings. Only some columns are read: the presets, map and rewards are not.

Client: AllianceBattleGroundConfigurationVO.parseXML (bundle line 145025), keyed by settingID in CastleAllianceBattleGroundData (bundle line 144859)

Fields:

Validators:

setting_id pydantic-field

setting_id: HorizonSettingId

Wire key settingID

The settings

max_alliance_size pydantic-field

max_alliance_size: int = 0

Wire key maxAllianceSize

Most members an alliance takes in

currency_id pydantic-field

currency_id: GameDataId['CurrencyId'] = 0

Wire key currencyID

The players' currency; 0 for none

alliance_currency_id pydantic-field

alliance_currency_id: GameDataId['CurrencyId'] = 0

Wire key allianceCurrencyID

The alliances' currency; 0 for none

booster_package_id pydantic-field

booster_package_id: PackageId = PackageId(0)

Wire key boosterCurrencyPackageID

The package that sells its booster currency; 0 for none

tower_effects pydantic-field

tower_effects: tuple[GameDataId['AllianceTowerEffect'], ...] = ()

Wire key allianceTowerEffectIDs

The alliance tower effects on offer

FeastDef pydantic-model

Bases: _Row

A feast you can hold for faster recruitment in every castle: its price, bonus, duration and the levels it is offered at.

Client: CastlePremiumMarketCollectionData.parseXML (split.js line 34586) reads the feasts rows into PremiumFestivalItemVO (split.js line 333225); getFestivalItemsByLevel (split.js line 34651) offers those from minLevel to maxLevel

Fields:

Validators:

feast_id pydantic-field

feast_id: GameDataId['Feast']

Wire key feastID

The feast

min_level pydantic-field

min_level: int = 0

Wire key minLevel

The lowest level it is offered at

max_level pydantic-field

max_level: int = 0

Wire key maxLevel

The highest level it is offered at

duration_seconds pydantic-field

duration_seconds: int = 0

Wire key duration

Seconds it lasts

recruitment_speed_bonus pydantic-field

recruitment_speed_bonus: int = 0

Wire key productionBoost

Recruitment speed bonus in percent

cost_food pydantic-field

cost_food: int = 0

Wire key costFood

Food it costs before the feast cost reduction; 0 for a ruby feast

cost_rubies pydantic-field

cost_rubies: int = 0

Wire key costC2

Rubies it costs; 0 for a food feast

feast_type pydantic-field

feast_type: str = ''

Wire key type

The kind its name is built from

sort_order pydantic-field

sort_order: int = -1

Wire key sortOrder

Its place in the feast list

is_ruby_priced property

is_ruby_priced: bool

Whether it costs rubies rather than food (hasC2Costs).

text_id property

text_id: str

The text id of its name, dialog_festival_<type>Event (nameTextID, split.js line 333269).

offered_at

offered_at(level: int) -> bool

Whether the feast dialog offers it at your level.

AllianceTowerEffectDef pydantic-model

Bases: _Row

An alliance tower effect of Beyond the Horizon: the bonus it gives, and how its price and strength grow per level.

Client: ABGAllianceTowerEffectXmlVO.parseXML (bundle line 145007)

Fields:

Validators:

tower_effect_id pydantic-field

tower_effect_id: GameDataId['AllianceTowerEffect']

Wire key allianceTowerEffectID

The tower effect

effect_id pydantic-field

effect_id: GameDataId['Effect'] = 0

Wire key effectID

The bonus it gives

base_price pydantic-field

base_price: int = 0

Wire key effectBasePrice

The price its levels grow from

max_level pydantic-field

max_level: int = 0

Wire key effectMaxLevel

Its highest level

start_value pydantic-field

start_value: float = 0.0

Wire key effectStartValue

Its strength at level 1

increase pydantic-field

increase: float = 0.0

Wire key effectIncrease

Its strength's growth

AllianceInvasionCampDef pydantic-model

Bases: _Row

An alliance invasion camp, by the id an aic push names it with while its event scales no difficulty; with a difficulty chosen, that id is a scaling camp's (GameData.scaling_camps).

The camp's defence, as the combat code reads it, is in GameData.camps["allianceInvasionCamps"].

Client: CastleAllianceInvasionCampNodeVO.parseXML (bundle line 111195), keyed by id in CastleAllianceInvasionCampData (bundle line 111180), whose getAllianceCamp (bundle line 111182) looks up a scaling camp instead when the event's difficulty scaling is on (AICCommand.executeCommand, bundle line 128192)

Fields:

Validators:

camp_id pydantic-field

Wire key allianceInvasionCampID

The camp

event_id pydantic-field

event_id: GameDataId['Event'] = 0

Wire key eventID

The event it is for

dungeon_level pydantic-field

dungeon_level: int = 0

Wire key dungeonlevel

Its level

rage_needed_for_level_up pydantic-field

rage_needed_for_level_up: int = 0

Wire key rageNeededForLevelUp

Alliance rage to its next level

player_rage_cap pydantic-field

player_rage_cap: int = 0

Wire key playerRageCap

Most rage a player builds

wall_bonus pydantic-field

wall_bonus: int = 0

Wire key wallBonus

Wall protection, in percent

gate_bonus pydantic-field

gate_bonus: int = 0

Wire key gateBonus

Gate protection, in percent

count_victory pydantic-field

count_victory: int = 0

Wire key countVictory

Its victory count

OasisSettlementDef pydantic-model

Bases: _Row

One level of a Beyond the Horizon Oasis Settlement: the trades it offers, its cooldown and the army it takes. Its allianceBattleGroundScoringID is not read: the scorings table is not loaded.

Client: TradingCampVO.parseXML (split.js line 717363), keyed by tradingCampID in ABGJadeCampData.parseXML (split.js line 717136)

Fields:

Validators:

settlement_id pydantic-field

settlement_id: OasisSettlementId

Wire key tradingCampID

The settlement level

name pydantic-field

name: str = ''

The row's internal name

settlement_type_id pydantic-field

settlement_type_id: int = 0

Wire key tradingCampTypeID

The settlement kind its levels share

level pydantic-field

level: int = 0

Its level

max_level pydantic-field

max_level: int = 0

Wire key maxLevel

Its kind's highest level

trade_group_id pydantic-field

trade_group_id: int = 0

Wire key tradeGroupID

The group of oasis_trades it offers

cooldown_seconds pydantic-field

cooldown_seconds: int = 0

Wire key cooldownSeconds

Seconds before it trades again

resource_limit pydantic-field

resource_limit: int = 0

Wire key resourceLimit

Troops it holds to trade

max_army_size pydantic-field

max_army_size: int = 0

Wire key maxArmySize

Most units one trade sends

travel_cost_multiplier pydantic-field

travel_cost_multiplier: float = 1.0

Wire key travelCostMultiplier

Factor on the travel cost to it

speed_multiplier pydantic-field

speed_multiplier: float = 1.0

Wire key speedMultiplier

Factor on the travel speed to it

is_max_level property

is_max_level: bool

Whether no higher level of its kind exists.

OasisTradeDef pydantic-model

Bases: _Row

A trade an Oasis Settlement offers: the materials one trade costs and what it brings.

Client: TradingCampTradeVO.parseXML (split.js line 717304), keyed by tradeID in ABGJadeCampData.parseXML (split.js line 717136); a settlement offers the trades of its tradeGroupID (getTradesForCamp, split.js line 717204)

Fields:

Validators:

trade_id pydantic-field

trade_id: OasisTradeId

Wire key tradeID

The trade

trade_group_id pydantic-field

trade_group_id: int = 0

Wire key tradeGroupID

The group the settlements offering it name

main_reward_id pydantic-field

main_reward_id: RewardId = RewardId(0)

Wire key mainRewardID

What one trade brings

secondary_reward_id pydantic-field

secondary_reward_id: RewardId = RewardId(0)

Wire key secondaryRewardID

What one trade brings besides

resource_consumed pydantic-field

resource_consumed: int = 0

Wire key resourceConsumed

The settlement's troops one trade uses up

loot_capacity_cost pydantic-field

loot_capacity_cost: int = 0

Wire key lootCapacityCost

Loot capacity one trade's materials take

costs pydantic-field

costs: tuple[Collectable, ...] = ()

The materials one trade costs

CitadelLevelDef pydantic-model

Bases: _Row

One level of the alliance Citadel in Beyond the Horizon's Jade Desert: its reach, defence and upgrade price.

A citadel stands at the highest level whose radius its current radius reaches (getAllianceCitadelVOByRadius, split.js line 715794).

Client: ABGAllianceCitadelVO.parseXML (split.js line 134851), read from allianceCitadels by CastleAllianceBattleGroundData (split.js line 715564); its costs keep only amounts above 0

Fields:

Validators:

citadel_level_id pydantic-field

citadel_level_id: CitadelLevelId

Wire key allianceCitadelID

The row

level pydantic-field

level: int = 0

The citadel level

radius pydantic-field

radius: int = 0

Fields the citadel reaches at this level

exposed_statuettes_percent pydantic-field

exposed_statuettes_percent: int = 0

Wire key exposedStatuettesPercentage

Percent of its Ancient Jade Statuettes attackers can take

scatter_weights pydantic-field

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

Wire key scatterWeights

Weights of where taken statuettes scatter

early_conversion_ratio pydantic-field

early_conversion_ratio: int = 0

Wire key earlyConversionRatio

Ancient Jade Statuettes per Restored Jade Statuette before the event ends

protection_mode_seconds pydantic-field

protection_mode_seconds: int = 0

Wire key protectionModeDuration

Seconds of protection after an upgrade

unit_wall_count pydantic-field

unit_wall_count: int = 0

Wire key unitWallCount

Defenders on its wall

wall_bonus pydantic-field

wall_bonus: int = 0

Wire key wallBonus

Wall protection, in percent

gate_bonus pydantic-field

gate_bonus: int = 0

Wire key gateBonus

Gate protection, in percent

moat_bonus pydantic-field

moat_bonus: int = 0

Wire key moatBonus

Moat protection, in percent

wall_level pydantic-field

wall_level: int = 0

Wire key wallLevel

Its wall's level

gate_level pydantic-field

gate_level: int = 0

Wire key gateLevel

Its gate's level

moat_level pydantic-field

moat_level: int = 0

Wire key moatLevel

Its moat's level

keep_level pydantic-field

keep_level: int = 0

Wire key keepLevel

Its keep's level

guards pydantic-field

guards: int = 0

Its guards

costs pydantic-field

costs: tuple[Collectable, ...] = ()

What upgrading to this level costs

LeagueTypeEventDef pydantic-model

Bases: _Row

One league's points thresholds and rewards in one event, for one reward set.

A league score event takes the first row of its event, sub type and league whose set is its RSID (any set while that is 0 or less).

Client: ALeagueTypeScoreEventVO.parseAdditionalXmlFromRoot and parseLeagueTypeEventElement (bundle lines 10268-10289); FactionEventVO.parseData (bundle line 7352) reads Berimond's rows by league and set

Fields:

Validators:

league_type_event_id pydantic-field

league_type_event_id: LeagueTypeEventId

Wire key leaguetypeEventsID

The row

event_id pydantic-field

event_id: GameDataId['Event'] = 0

Wire key eventID

The event it is for

league_type_id pydantic-field

league_type_id: GameDataId['LeagueType'] = 0

Wire key leaguetypeID

The league it rewards

sub_type pydantic-field

sub_type: int = 0

Wire key subType

The event's sub type

reward_set_id pydantic-field

reward_set_id: RewardSetId = RewardSetId(0)

Wire key rewardSetID

The reward set it belongs to

needed_points pydantic-field

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

Wire key neededPointsForRewards

The points each reward tier needs, before the event's point scale

reward_ids pydantic-field

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

Wire key rewardIDs

One reward list per , part, in the row's order

top_x pydantic-field

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

Wire key topXValue

The ranks the top-rank rewards go to

hard_mode_start pydantic-field

hard_mode_start: int = 0

Wire key hardModeStart

Points above which the tiers are hard mode's; 0 for none

alliance_reward_threshold_points pydantic-field

alliance_reward_threshold_points: int = 0

Wire key allianceRewardThresholdPoints

Points a player needs for the alliance rewards

rewards

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

What each tier gives, in the order of reward_ids.

Client: createListsFromRewardIdsString (bundle line 40529) builds each list with rewardData.getListById

LeaderboardRewardDef pydantic-model

Bases: _Row

The rewards of one rank band of an event's leaderboard, in one reward set.

Client: LeaderboardRewardVO.fillFromParamXML (bundle line 112034), keyed by id in CastleLeaderBoardRewardsData (bundle line 112005)

Fields:

Validators:

leaderboard_reward_id pydantic-field

leaderboard_reward_id: LeaderboardRewardId

Wire key leaderboardRewardID

The row

event_id pydantic-field

event_id: GameDataId['Event'] = 0

Wire key eventTypeID

The event it is for

reward_set_id pydantic-field

Wire key leaderboardRewardSetID

The reward set it belongs to

max_rank pydantic-field

max_rank: int = 0

Wire key maxRank

The lowest rank the band reaches

reward_ids pydantic-field

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

Wire key rewardIDs

Its rewards

league_type_id pydantic-field

league_type_id: GameDataId['LeagueType'] = -1

Wire key leagueID

The league it is for; -1 for every league

rewards

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

What the band gives.

Client: rewardData.getListByIdArray(rewardIDs) (CastleLeaderBoardRewardsData.getRewardListForDialogList, bundle line 112017)

BerimondSpecialCampDef pydantic-model

Bases: _Row

A Battle for Berimond special camp: a watchtower, a capital or the resource village, by the id map rows and the afd targets name it with.

Client: FactionEventVO.parseAdditionalXmlFromRoot (bundle line 7398) reads specialcampID, type and distance, FactionTowerInfoVO.parseXML and FactionCapitalInfoVO.parseXML (bundle lines 88030, 88004) the lane, position, villages and unlocks. The level, attacks and loot columns are the server's: the client never reads them.

Fields:

Validators:

special_camp_id pydantic-field

special_camp_id: GameDataId['BerimondSpecialCamp']

Wire key specialcampID

The camp

camp_type pydantic-field

camp_type: GameDataKey[BerimondSpecialCampType] = ''

Wire key type

What it is; empty for none

distance pydantic-field

distance: int = 0

Its distance

lane_id pydantic-field

lane_id: GameDataId[BerimondLane] = 0

Wire key laneID

The lane it stands on; 0 for the resource village

village_count pydantic-field

village_count: int = 0

Wire key villageCount

A watchtower's villages

sector_x pydantic-field

sector_x: int = 0

Wire key CampPosX

Its x in the event's sector

sector_y pydantic-field

sector_y: int = 0

Wire key CampPosY

Its y in the event's sector

unlock_ids pydantic-field

unlock_ids: tuple[GameDataId['BerimondSpecialCamp'], ...] = ()

Wire key unlockIDs

A capital's camps, as the client lists them

level pydantic-field

level: int = 0

Wire key dungeonlevel

Its level

attacks_until_destroyed pydantic-field

attacks_until_destroyed: int = 0

Wire key attacksUntilDestroyed

The attacks that destroy it; 0 for none

loot_coins pydantic-field

loot_coins: int = 0

Wire key lootc1

The coins it lists as loot

loot_rubies pydantic-field

loot_rubies: int = 0

Wire key lootc2

The rubies it lists as loot

loot_wood pydantic-field

loot_wood: int = 0

Wire key lootWood

The wood it lists as loot

loot_stone pydantic-field

loot_stone: int = 0

Wire key lootStone

The stone it lists as loot

loot_food pydantic-field

loot_food: int = 0

Wire key lootFood

The food it lists as loot

loot_mead pydantic-field

loot_mead: int = 0

Wire key lootMead

The mead it lists as loot

loot_beef pydantic-field

loot_beef: int = 0

Wire key lootBeef

The beef it lists as loot

row_id

row_id(value: object) -> int

The row's own id, parseInt of it; a row without one is skipped, as nothing can look it up.

is_research_cost_column

is_research_cost_column(column: str) -> bool

Whether a researches column is a cost: cost<name> or globalServerCost<name>.

is_cost_column

is_cost_column(column: str) -> bool

Whether an items column is a cost<name> column.

gamedata.table

A game-data table: rows keyed by id, each validated the first time it is read.

Loading the game data then costs no row validation at all: a table holds the items rows as the file has them, trimmed to the columns its model reads, and validates a row when it is asked for.

Classes:

Name Description
Table

One items table by id, read-only.

logger module-attribute

logger = logging.getLogger(__name__)

K module-attribute

K = TypeVar('K')

R module-attribute

R = TypeVar('R', bound=BaseModel)

Table

Table(model: type[R], id_field: str, rows: Mapping[int, dict[str, Any]], *, name: str = '', context: dict[str, Any] | None = None)

Bases: Mapping[K, R], Generic[K, R]

One items table by id, read-only.

Reading a row by id (table[Building.KEEP_L1], table.get(171), 171 in table) validates that row alone. Iterating, len() or comparing validates every row once, and keys come back as the rows' ids: the enum member, or the plain int of an id the enum lacks. A row that does not fit its model is left out, as if the table did not have it, with a warning the first time it is read. A table is shared by every thread that reads the game data: each row is validated once, so table[k] is table[k] holds across threads. context is passed to each row's validation, for a model that reads a row by another table.

gamedata.collectables

Collectables: one reward, cost or lot of goods, typed by kind, as the client's single parser reads them.

The server sends collectables in two layouts, which the client reads with one key table:

  • rows, [[key, entry, amount?], ...] (a mission's rewards, goods on their way): CollectableRows
  • an object, {key: [entry, ...], "SO": sort order} (the login bonus): CollectableObject

Each entry's layout depends on its kind ([unit_id, amount] under U, an amount under C1, {"ID": booster id, "D": seconds} under B, ...); Collectable reads it into item, amount and duration_seconds. An entry under a key the client has no type for is kept as CollectableKind.OTHER with its key and value, where the client drops it.

Classes:

Name Description
Collectable

One collectable: a reward, a cost or a lot of goods, typed by its kind.

Attributes:

Name Type Description
CollectableItem
MINUTE_SKIP_FIRST_ID

The start of the minute skips' currency id range: items currencyTypes row MinuteSkip ("1000-1999").

CollectableRows

A model field read from collectable rows, [[key, entry, amount?], ...] (see Collectable.from_rows).

CollectableObject

A model field read from a reward object, {key: [entry, ...]} (see Collectable.from_object).

CurrencyIdRows

A model field read from [[currency_id, amount], ...] rows, one currency collectable per row, as sent.

CurrencyAmounts

Currencies by id and amount, sent as [[currency_id, amount], ...] in insertion order.

CollectableItem module-attribute

MINUTE_SKIP_KEY module-attribute

MINUTE_SKIP_KEY = 'MS'

A minute skip sent as ["MS<n>", amount]: the currency MINUTE_SKIP_FIRST_ID + n.

MINUTE_SKIP_FIRST_ID module-attribute

MINUTE_SKIP_FIRST_ID = 1000

The start of the minute skips' currency id range: items currencyTypes row MinuteSkip ("1000-1999").

Client: CollectableHelper.getTypeByServerKey (bundle lines 1604-1605), XmlCurrencyRangeVO.parseXml (bundle line 141268)

PACKAGE_REWARD_COLUMNS module-attribute

PACKAGE_REWARD_COLUMNS = frozenset({*_PACKAGE_COLUMNS, 'packageIDs', 'lootBox', 'buildingAmount', 'unitAmount', 'specialHeroOfRarenessID', 'constructionItemAmount', 'equipmentIDs', 'enchantedEquipmentIDs', 'specialEquipmentOfRarenessID', 'gemIDs', 'specialGemOfLevelID'})

Every column the switch of createRewardList reads.

CollectableRows module-attribute

CollectableRows = Annotated[tuple[Collectable, ...], BeforeValidator(_collectables(Collectable.from_rows))]

A model field read from collectable rows, [[key, entry, amount?], ...] (see Collectable.from_rows).

CollectableObject module-attribute

CollectableObject = Annotated[tuple[Collectable, ...], BeforeValidator(_collectables(Collectable.from_object))]

A model field read from a reward object, {key: [entry, ...]} (see Collectable.from_object).

CurrencyIdRows module-attribute

CurrencyIdRows = Annotated[tuple[Collectable, ...], BeforeValidator(_currency_id_rows)]

A model field read from [[currency_id, amount], ...] rows, one currency collectable per row, as sent.

Unlike CurrencyAmounts, rows are not added up and an amount keeps its sign.

Client: CollectableItemGenericCurrencyVO(e[0], e[1]) per row (bundle line 138308)

CurrencyAmounts module-attribute

CurrencyAmounts = Annotated[dict[EnumOrInt['CurrencyId'], int], BeforeValidator(_currency_rows), PlainSerializer(_rows_of)]

Currencies by id and amount, sent as [[currency_id, amount], ...] in insertion order.

Unlike CollectableRows, the rows name the currency by its currencyID, not a server key.

Client: CastleFightScreenVO.addCollectorBooster (bundle line 30584) pushes [currency_id, amount]

Collectable pydantic-model

Bases: EmpireModel

One collectable: a reward, a cost or a lot of goods, typed by its kind.

item is what the entry names, for the kinds that name one: the unit or tool for UNITS, the Currency for CURRENCY, the BoosterId for a booster, the loot box, building, construction item, gem or crest layout, the rareness of a random equipment, or the id of an equipment, crest symbol, gift package or material bag, which no enum names. amount is how many; an entry that names an item without a count is 1.

Client: CollectableHelper.getTypeByServerKey and createVO (bundle lines 1603-1629), then the item class's parseServerObject

Fields:

model_config class-attribute

model_config: ConfigDict = ConfigDict(frozen=True)

kind pydantic-field

What it is

key pydantic-field

key: str

The server key it came under, as sent (for a game-data reward, its kind's or currency's); the only name an OTHER entry has

amount pydantic-field

amount: int | float = 1

How many

item pydantic-field

item: CollectableItem | None = None

What the entry names; None for a kind that names nothing

duration_seconds pydantic-field

duration_seconds: int | float | None = None

How long it lasts, for a booster, VIP time or crest layout; None otherwise

value pydantic-field

value: Any = None

The entry as sent, for an OTHER entry and a kind whose layout is not read here (relics, equipment sent whole, alliance gifts); None otherwise

send_key property

send_key: str

The key the client sends for this collectable, as when the login bonus reward is picked.

A currency goes as its own key, anything else as its kind's key: a booster with a kind of its own as that kind's (PG, XPB, ...), a hero random equipment as RE.

Raises:

Type Description
ValueError

An OTHER entry, which the client never offers, or a currency whose key is unknown

Client: CollectableHelper.getServerKeyByCollectable (bundle line 1646)

from_entry classmethod

from_entry(key: str, entry: Any, amount: Any = None) -> Collectable

One entry under its server key; amount is the third place of a row, where it has one.

Client: CollectableParserS2CParamList.createByParamListMethod (bundle line 40569), LostAndFoundListItemVO.parseData (bundle line 144545)

from_object classmethod

from_object(value: Any) -> tuple[Collectable, ...]

A reward object {key: [entry, ...], "SO": sort order} as its collectables, in the order sent.

A key whose value is no list is skipped, as the client skips a null one; SO only sorts the display.

Client: CollectableParserS2CParamObject.createList and parseSortOrder (bundle lines 62810-62818)

from_rows classmethod

from_rows(value: Any) -> tuple[Collectable, ...]

Collectable rows [[key, entry, amount?], ...], a list of such lists, or an old-style goods list.

An old-style list holds amounts in a fixed order of goods and currencies, a 0 for none.

Client: CollectableParserS2CParamList.createList and createByParamListMethod (bundle lines 40560-40573), CollectableParserS2COldGoods.createByParamListOldGoods (bundle line 62797)

of_currency classmethod

of_currency(currency_id: int, amount: int | float = 1) -> Collectable

A currency named by its currencyID, under its server key (the id itself where the key is unknown).

Client: CollectableItemGenericCurrencyVO (bundle line 5258) takes the id and amount

from_reward_row classmethod

from_reward_row(row: Mapping[str, Any], currency_ids: Mapping[str, int]) -> tuple[Collectable, ...]

What one rewards row of the items gives, in the client's order.

Each column of a kind holds #-separated parts, read as the kind's item class reads them; then each add<name> column adds one more, of the kind name names or else the currency whose Name it is (currency_ids, by name); duplicates the client adds up are added up. An add column naming neither is kept as OTHER, where the client drops it. A random equipment of a hero rareness reads as HERO_RANDOM, as a packet's does. The columns no parser reads (comment1, hiddenFood, ignore* and the like) give nothing.

Client: CollectableParserX2CRewards.createList (bundle line 62897) and CollectableParserX2CList.createList (bundle line 62874) with CurrencyData.getXmlCurrencyByName (bundle line 141193)

from_columns classmethod

from_columns(row: Mapping[str, Any], prefix: str, currency_ids: Mapping[str, int]) -> tuple[Collectable, ...]

One collectable per <prefix><name> column of an items row, in the row's order: a research's cost columns, a reward's add columns.

name is a kind's items key (C2, Wood) or else the Name of a currency (LegendaryToken, by currency_ids). A column naming neither is kept as OTHER, where the client drops it.

Client: CollectableParserX2CList.createList (bundle lines 62874-62881) with CurrencyData.getXmlCurrencyByName (bundle line 141193)

package_costs classmethod

package_costs(row: Mapping[str, Any], currency_ids: Mapping[str, int]) -> tuple[Collectable, ...]

What an event package row costs before discounts: each goods' packagePrice<name> above 0, in the client's goods order, then its cost columns; rubies 0 for a row with neither.

A column naming no kind or currency is dropped, as the client drops it.

Client: CollectableParserX2CEventPackages.createCostList (split.js line 325525), CollectableHelper.getGoodsKeySuffix (split.js line 9426)

package_rewards classmethod

package_rewards(row: Mapping[str, Any], currency_ids: Mapping[str, int], bundled: Mapping[int, tuple[Collectable, ...]] | None = None) -> tuple[Collectable, ...]

What an event package row gives: its add, amount and kind or currency columns, each pass added up with the ones before, then the columns the client reads one by one, in the row's order.

bundled are the rewards of the packages a bundle's packageIDs names, by package id; a package it lacks gives nothing, as in the client. A column naming no kind or currency is dropped.

Client: CollectableParserX2CEventPackages.createRewardList (split.js line 325561) with CollectableParserX2CList.createList (split.js line 325769)

merged staticmethod

merged(collectables: Iterable[Collectable]) -> tuple[Collectable, ...]

The collectables with the duplicates the client adds up added up, each into the first it adds up with.

Most kinds add up by kind; currencies, units, buildings, construction items, material bags and crest layouts only for the same item; boosters, equipment, gems, relics and the other one-off kinds never. VIP time, dungeon protection and crest layouts add their durations, the others their amounts. Two different loot boxes add up into the first one's box, as in the client. The client also requires the same grant type, which a collectable does not carry: the collectables of one reward share theirs, so merge only collectables of one grant type.

Client: CollectableList.combineDuplicatedItems (bundle line 1887), isCombineAbleWith and combineWith of ACollectableItemVO (bundle lines 3569, 3558) and its overrides

is_reward_column

is_reward_column(column: str) -> bool

Whether a rewards row column holds a collectable: a kind's items column or an add column.

is_package_column

is_package_column(column: str) -> bool

Whether a packages column can hold a cost or a reward: a prefixed column, a kind's or a currency's name.

gamedata.lenient

Lenient id fields: the enum member for an id the enum knows, the plain value for one it does not.

A client release can send an id the generated enums do not have yet. A field typed EnumOrInt[Kingdom] keeps such an id as its int instead of failing the packet, and logs a warning once per id. EnumOrInt[Unit, Tool] takes a member of either, for an id from a table two enums share. Name a generated enum by its name in quotes (EnumOrInt["QuestId"], the enum imported under TYPE_CHECKING) so its module loads only when a value arrives; the largest of them hold thousands of members.

Inside the items tables GameDataId[E] and GameDataKey[E] do the same without the warning: loading items newer than the enums already warns once for the whole version.

Classes:

Name Description
LenientEnum

The validator behind the lenient types: reads the id, then looks its member up.

EnumOrInt

EnumOrInt[E]: a member of the IntEnum E, or the plain int of an id E lacks.

EnumOrStr

EnumOrStr[E]: a member of the str Enum E, or the plain str of a key E lacks.

GameDataId

GameDataId[E]: EnumOrInt[E] for an id inside the items tables, kept without a warning.

GameDataKey

GameDataKey[E]: EnumOrStr[E] for a fixed text column of the items tables, kept without a warning.

Functions:

Name Description
known

The member of the first of enums that has value, else value itself.

logger module-attribute

logger = logging.getLogger(__name__)

LenientEnum

LenientEnum(enum: type[Enum] | str | tuple[type[Enum] | str, ...], base: type[int] | type[str], *, warn: bool = True)

The validator behind the lenient types: reads the id, then looks its member up.

Attributes:

Name Type Description
base
warn
enums tuple[type[Enum], ...]

The enums, in lookup order; one named by a string is looked up among the game-data id enums on first use.

base instance-attribute

base = base

warn instance-attribute

warn = warn

enums property

enums: tuple[type[Enum], ...]

The enums, in lookup order; one named by a string is looked up among the game-data id enums on first use.

EnumOrInt

EnumOrInt[E]: a member of the IntEnum E, or the plain int of an id E lacks.

EnumOrInt[E, F] looks the id up in E, then in F.

EnumOrStr

EnumOrStr[E]: a member of the str Enum E, or the plain str of a key E lacks.

GameDataId

GameDataId[E]: EnumOrInt[E] for an id inside the items tables, kept without a warning.

GameDataId[E, F] looks the id up in E, then in F.

GameDataKey

GameDataKey[E]: EnumOrStr[E] for a fixed text column of the items tables, kept without a warning.

known

known(enums: type[_E] | Iterable[type[_E]], value: Any, *, warn: bool = True) -> _E | Any

The member of the first of enums that has value, else value itself.

A value none of them has is logged once per enum name and value, unless warn is False.

gamedata.effect_texts

An effect with its value, described the way the game's tooltips describe it.

Usage
from empire_core.gamedata import EffectTemplate, describe_construction_item, describe_effect

item = game_data.construction_items[ConstructionItem.BARRACKS_COST_G1_L1]
describe_construction_item(item)        # "-2% recruitment costs"
describe_effect(gem.effects[0], EffectTemplate.EQUIPMENT, trigger_chance=gem.trigger_chance)

The text comes from the language file (empire_core.texts), fetched on first use and cached; the game data names the effect and how its value reads.

Functions:

Name Description
describe_effect

One bonus as the game describes it in lang: "-5% recruitment costs".

describe_effects

Each bonus as describe_effect describes it; an effect game_data lacks is left out.

describe_construction_item

A construction item's bonuses as its tooltip lists them, one per line: the fixed bonuses of its own

describe_building

A decoration's effects as its info lists them, its effects then its area_specific_effects, each with

Number module-attribute

Number = int | float | None

Replacements module-attribute

Replacements = Callable[[EffectValue, 'GameData', str], list[object]]

describe_effect

describe_effect(effect: EffectValue | EquipmentEffectValue, template: EffectTemplate = CONSTRUCTION_ITEM, *, trigger_chance: int = 100, lang: str = 'en', game_data: GameData | None = None) -> str | None

One bonus as the game describes it in lang: "-5% recruitment costs".

The text is the template's for the effect, filled with the value as the effect's type reads it (one number, the value of the first unit it names, the ids it unlocks, ...). An equipment effect resolves to its effect and always reads as equipment. A gem that does not always trigger (GemDef.trigger_chance below 100) reads gem_effect_description_<gem type> with the chance first. Fetches the language file on first use (empire_core.texts.text).

Returns:

Type Description
str | None

The description; None when game_data does not have the effect

Client: EffectTypeEnum registrations (bundle line 1322) choose the value class, whose textReplacements fill the text

describe_effects

describe_effects(effects: Iterable[EffectValue], template: EffectTemplate = CONSTRUCTION_ITEM, *, lang: str = 'en', game_data: GameData | None = None) -> list[str]

Each bonus as describe_effect describes it; an effect game_data lacks is left out.

describe_construction_item

describe_construction_item(item: ConstructionItemDef, *, lang: str = 'en', game_data: GameData | None = None) -> str

A construction item's bonuses as its tooltip lists them, one per line: the fixed bonuses of its own columns (ci_effect_<column>, the value as it is), then its effects; ci_effect_NA for none.

Client: ConstructionItemVO.effectText (bundle line 47766), the fixed bonuses' text from CastleEffectVO.constructionItemTextId (bundle line 79073)

describe_building

describe_building(building: BuildingDef, *, lang: str = 'en', game_data: GameData | None = None) -> list[str]

A decoration's effects as its info lists them, its effects then its area_specific_effects, each with its cap.

Client: ABasicBuildingVO.allBuildingEffects (bundle line 18113) and ADecoBuildingVO.createAdditionalEffectItems (bundle line 11897)

gamedata.troops

Telling troops from equipment in a unit dict, by the loaded game data.

Troops are the units rows without slotTypes, which GameData keeps as its units; the rows with them are tools. The ids come from GameData.load, so they share its one download, cache and failure backoff.

With no game data loaded, a CDN outage makes get_troop_ids raise NetworkError rather than return an empty set, so callers can tell "metadata unavailable" apart from "no troop IDs". count_troops still degrades to counting every unit in that case, which inflates the count; see its docstring.

Functions:

Name Description
troop_data_available

Whether game data is loaded in this process, i.e. whether troop counts are exact.

get_troop_ids

The wodID of every troop: the ids of the loaded game data's units.

count_troops

Count only actual troops in a unit dict, excluding equipment.

logger module-attribute

logger = logging.getLogger(__name__)

troop_data_available

troop_data_available() -> bool

Whether game data is loaded in this process, i.e. whether troop counts are exact.

Returns:

Type Description
bool

True once a GameData.load has succeeded here, so

bool

count_troops filters equipment out. False means

bool

count_troops would load the game data first, or fall back to counting

bool

every unit. This does not touch the network.

get_troop_ids

get_troop_ids(force_refresh: bool = False) -> set[int]

The wodID of every troop: the ids of the loaded game data's units.

Uses the game data already loaded in the process (GameData.loaded, which client.game_data reads too), and loads it through GameData.load when there is none.

Parameters:

Name Type Description Default
force_refresh bool

Load the game data again, past its cache and failure backoff

False

Returns:

Type Description
set[int]

Set of wodID values for valid troops. An empty set means the CDN data

set[int]

genuinely listed no troops - a fetch failure raises instead.

Raises:

Type Description
NetworkError

The game data is not loaded and could not be. Within five minutes of a failed fetch this is raised without another request.

count_troops

count_troops(units: dict[int, int], troop_ids: set[int] | None = None) -> int

Count only actual troops in a unit dict, excluding equipment.

Parameters:

Name Type Description Default
units dict[int, int]

Dict of {unit_id: count}

required
troop_ids set[int] | None

Explicit set of valid troop IDs. Taken from the game data (loading it if needed) when omitted. An explicitly empty set counts nothing, since it means "no unit ID is a troop".

None

Returns:

Type Description
int

Total count of actual troops.

int

Degraded fallback: when troop_ids is omitted and the game data

int

cannot be loaded, every unit is counted - including equipment - so the

int

result can be inflated. The fallback warns (throttled to once per

int

retry interval); callers that need to know whether a count is exact

int

should check troop_data_available, or call

int

get_troop_ids themselves and handle NetworkError.

gamedata.cdn

The items payload on the GGE CDN, fetched without any caching.

GameData.load is the one place that calls these, caches the result and backs off after a failure; everything else reads the game data through it.

Functions:

Name Description
get_items_version

The current items version, from ItemsVersion.properties.

fetch_items_data

The full items_v{version}.json payload.

get_items_version

get_items_version() -> str

The current items version, from ItemsVersion.properties.

Client: BasicFrameOne.loadItemVersionXML loads {baseURL}/ItemsVersion.properties (ggs.dll lines 3928 and 32238) and onVersionPropertiesLoaded keeps the text after the first =, trimmed (ggs.dll line 32240).

Raises:

Type Description
ValueError

The text is not dotted digits (786.03), so it is never put in a URL or file name

fetch_items_data

fetch_items_data(version: str) -> dict[str, Any]

The full items_v{version}.json payload.

Generated ids

One enum per items table, generated for one items version (ITEMS_VERSION). Only the classes are shown here; their members are in the source and in your editor's autocomplete.

Game-data ids as enums, so they autocomplete.

One enum per items table, each member named from the row in UPPER_SNAKE; where two rows would share a name, both carry their id (SPEED_BOOST_2). Currencies and researches are named from the game's English text (Currency.SKIP_5_MINUTES is "MS2"), where the row has its own. Members are plain ints (Currency members plain strs), so they go on the wire and into models as their value.

Most members also carry their row's fixed id and number columns, e.g. Unit.MEAD_RANGER_L6.role and .level or Tool.X.category, so [t for t in Tool if t.category == "Defence"] works without game data. Anything a balance patch can change is not baked in: for the full row, load a GameData (nothing here downloads it) and index its table with the member, e.g. game_data.units[Unit.MEAD_RANGER_L6].

Enums whose rows the game names by a text (units, tools, currencies, researches, generals, Legendary and sceat skills, events, gems, achievements, titles, crest layouts, main quests, prebuilt castles, private villages, fusion forges, judgements, treasure maps, league types, feasts) have display_name(lang="en"), the name the game shows: Unit.MEAD_RANGER_L6.display_name("de"). It reads the language file, fetched on first use and cached (empire_core.texts).

ITEMS_VERSION is the items version they were generated from, and is_current says whether a loaded GameData is that version. For anything newer, use the named lookups on GameData.

Relic effects and alliance buffs have no enum, as the game names none of their rows; look them up by id on GameData (relic_effects, alliance_buffs). Equipment effects, which the game names by nothing but the effect they give, are named from that effect, their bonus and their wearer. Nor do the 27,000 rewards have one: the game shows no text for one, and the notes some rows carry name where it is given, not the reward.

Regenerate with uv run python scripts/generate_gamedata_ids.py.

Modules:

Name Description
achievements
alliance_crests
alliance_tower_effects
berimond_special_camps
buildings
construction_items
currencies
daily_quests
daimyo_camps
difficulty_types
effect_types
effects
equipment_effects
equipment_groups
events
feasts
fusion_forges
gem_colors
gems
general_abilities
general_rarities
general_skills
generals
generals_hub_characters
global_effects
horses
judgements
league_types
legendary_skills
loot_box_types
loot_boxes
main_quests
prebuilt_castles
private_villages
quests
raid_bosses
researches
sceat_skills
titles
tools
treasure_maps
units

Classes:

Name Description
Achievement

Achievement ids from the achievements table, named from the series' English name and the step as its level; the

AllianceCrestColor

Alliance crest colour ids from the allianceCoatColors table. The game names no colour, so each is named by its

AllianceCrestLayout

Alliance crest layout ids from the allianceCoatLayouts table, named from the game's English name, else the

AllianceTowerEffect

Beyond the Horizon's alliance tower effect ids from the allianceTowerEffects table, named from the game's

BerimondSpecialCamp

Battle for Berimond special camp ids from the specialcamps table: watchtowers, capitals and the resource

Building

Building wodID values from the buildings table, named name, type (for decorations) and level.

ConstructionItem

Construction item ids from the constructionItems table, named name, group and level.

Currency

Currency keys from the currencies table, the key the server uses, named from the game's English name; coins and

CurrencyId

Currency ids from the currencies table, as other tables reference them; names match Currency.

DailyQuestId

Daily quest ids from the dailyactivities table, named from what the first condition counts. Named DailyQuestId,

DaimyoCastle

Daimyo castle ids from the daimyoCastles table, named from the rank the game names the area by and the level:

DaimyoTownship

Township ids from the daimyoTownships table, named from the rank the game names the area by and the level: the

DifficultyType

Event difficulty type ids from the eventAutoScalingDifficultyTypes table.

EffectType

Effect type ids from the effecttypes table.

Effect

Effect ids from the effects table.

EquipmentEffect

Equipment effect ids from the equipment_effects table, the bonuses equipment rolls, named from the effect each

EquipmentGroup

Equipment item group ids from the equipment_groups table, as equipment effects name them.

Event

Event ids from the events table, named from the title players see, else eventType.

Feast

Feast ids from the feasts table, named from the game's English name.

FusionForgeId

Fusion forge ids from the fusionSystems table, which the fusionForges table shares, named from the game's

GemColor

Gem colour ids from the gemColors table, named from the game's English tooltip for the colour.

Gem

Gem ids from the gems table, named from the game's English name and, unless unique, level.

GeneralAbility

General ability ids from the generalAbilities table, one per level.

GeneralRarity

General rarity ids from the generalRarities table, named from name; the client's colours call the third epic

GeneralSkill

General skill ids from the generalSkills table, named general, skill and level.

General

General ids from the generals table.

GeneralsHubCharacter

Generals hub character ids from the characters table, named from name; the client's constants are

GlobalEffect

Global effect ids from the globalEffects table.

Horse

Travel booster wodID values from the horses table, the HBW movements send, named from the comment2

Judgement

Citizen judgement ids from the judgements table, named from the game's English name, else visualName.

LeagueType

League type ids, the LID of the highscore commands, named from the highscore's title for each league: its level

LegendarySkill

Legendary skill ids from the legendskills table, named effect type, tree, group and level.

LootBoxType

Loot box type ids from the lootBoxTypes table, named from lootBoxTheme; keys count per type.

LootBox

Loot box ids from the lootBoxes table, named name and rarity.

MainQuest

Main quest ids from the mainquests table, the quest book's chapters, named from the game's English title.

PrebuiltCastle

Prebuilt castle ids from the prebuiltcastles table: the castles and camps a kingdom, a season event's map or a

PrivateVillageType

Private resource village ids from the privateVillages table, one per kind, kingdom and level, named from the

QuestId

Quest ids from the quests table, named from what the first condition counts; most names carry their id, as many

RaidBoss

Alliance raid boss ids from the raidBosses table.

Research

Research ids from the researches table, named from the game's English title and level; a blueprint or recipe

SceatSkill

Sceat skill ids from the sceatSkills table, named from the game's English name and level.

Title

Title ids from the titles table, named from the game's English title.

Tool

Tool wodID values from the units table (rows with slotTypes).

TreasureMapId

Treasure map ids from the tmaps table: the season events' maps and the treasure hunt's, named from the game's

Unit

Unit wodID values from the units table (rows without slotTypes).

Functions:

Name Description
is_current

Whether game_data is the items version these enums were generated from.

Achievement

Bases: IntEnum

Achievement ids from the achievements table, named from the series' English name and the step as its level; the main series from what it counts.

Client: AchievementVO.fillFromParamXML (bundle line 92882); names from AchievementSerieVO.nameString (bundle line 92822)

Methods:

Name Description
display_name

The game's name for it in lang, the text achievementName_<series_id>.

Attributes:

Name Type Description
series_id int

The series it is a step of.

series_number int

Its step in the series.

text_id str

The text id of its name, achievementName_<series_id>.

series_id instance-attribute

series_id: int

The series it is a step of.

series_number instance-attribute

series_number: int

Its step in the series.

text_id property

text_id: str

The text id of its name, achievementName_<series_id>.

display_name

display_name(lang: str = 'en') -> str

The game's name for it in lang, the text achievementName_<series_id>.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: AchievementSerieVO.nameString (bundle line 92822)

AllianceCrestColor

Bases: IntEnum

Alliance crest colour ids from the allianceCoatColors table. The game names no colour, so each is named by its id and carries its hex colour.

Client: AllianceCrestColorVO.parseXML (bundle line 111012)

Attributes:

Name Type Description
color str

The colour as hex text, e.g. 0xDBDACA.

color instance-attribute

color: str

The colour as hex text, e.g. 0xDBDACA.

AllianceCrestLayout

Bases: IntEnum

Alliance crest layout ids from the allianceCoatLayouts table, named from the game's English name, else the comment1 note.

Client: AllianceCrestLayoutVO.parseXML (bundle line 111024); names from CollectableItemAllianceCrestLayoutVO.getNameTextId (bundle line 89359)

Methods:

Name Description
display_name

The game's name for it in lang, the text allianceCoat_Layout_name_<value>.

Attributes:

Name Type Description
color_count int

Colours it takes.

text_id str

The text id of its name, allianceCoat_Layout_name_<value>.

color_count instance-attribute

color_count: int

Colours it takes.

text_id property

text_id: str

The text id of its name, allianceCoat_Layout_name_<value>.

display_name

display_name(lang: str = 'en') -> str

The game's name for it in lang, the text allianceCoat_Layout_name_<value>.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: CollectableItemAllianceCrestLayoutVO.getNameTextId (bundle line 89359)

AllianceTowerEffect

Bases: IntEnum

Beyond the Horizon's alliance tower effect ids from the allianceTowerEffects table, named from the game's English name, else the effect each gives.

Client: ABGAllianceTowerEffectXmlVO.parseXML (bundle line 145007); names from CastleABGTowerEffectsDialogItem.fill (bundle line 71074)

Methods:

Name Description
display_name

The game's name for it in lang, the text dialog_beyondTheHorizon_AllianceTower_<effect name>_name; None

Attributes:

Name Type Description
text_id str

The text id the game names it by, which display_name reads.

text_id instance-attribute

text_id: str

The text id the game names it by, which display_name reads.

display_name

display_name(lang: str = 'en') -> str | None

The game's name for it in lang, the text dialog_beyondTheHorizon_AllianceTower_<effect name>_name; None for a row without one.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: CastleABGTowerEffectsDialogItem.fill (bundle line 71074)

BerimondSpecialCamp

Bases: IntEnum

Battle for Berimond special camp ids from the specialcamps table: watchtowers, capitals and the resource village, named from the lane's faction and place and the camp's English name.

Client: FactionEventVO.parseAdditionalXmlFromRoot (bundle line 7398); names from areaNameString of the faction map objects (bundle lines 22840, 22792, 28559), lanes from FactionCapitalInfoVO (bundle line 88021)

Attributes:

Name Type Description
camp_type str

What it is, a BerimondSpecialCampType value.

lane_id int

Its lane, a BerimondLane value; 0 for none.

camp_type instance-attribute

camp_type: str

What it is, a BerimondSpecialCampType value.

lane_id instance-attribute

lane_id: int

Its lane, a BerimondLane value; 0 for none.

Building

Bases: IntEnum

Building wodID values from the buildings table, named name, type (for decorations) and level.

Client: AVisualVO.parseXmlNode (bundle line 17800) reads name, group and type, AShopVO.parseXmlNode (bundle line 31713) the level

Attributes:

Name Type Description
group str

The group column, e.g. Building or Tower.

level int

Upgrade level; -1 when the row has none.

group instance-attribute

group: str

The group column, e.g. Building or Tower.

level instance-attribute

level: int

Upgrade level; -1 when the row has none.

ConstructionItem

Bases: IntEnum

Construction item ids from the constructionItems table, named name, group and level.

Client: ConstructionItemVO.parseBasicValues (bundle line 47719)

Attributes:

Name Type Description
group_id int

The constructionItemGroupID column.

level int

Upgrade level; -1 when the row has none.

rareness_id int

The rarenessID column.

group_id instance-attribute

group_id: int

The constructionItemGroupID column.

level instance-attribute

level: int

Upgrade level; -1 when the row has none.

rareness_id instance-attribute

rareness_id: int

The rarenessID column.

Currency

Bases: str, Enum

Currency keys from the currencies table, the key the server uses, named from the game's English name; coins and rubies are not in it.

Client: CurrencyData.getXmlCurrencyByKey (bundle line 141194); names from currency_name_<assetName or Name> (CollectableItemGenericCurrencyVO.getNameTextId, bundle line 5267)

Methods:

Name Description
display_name

The game's name for it in lang, the text currency_name_<assetName or Name>.

Attributes:

Name Type Description
currency_id int

The currency's id, as other tables reference it.

text_id str

The text id the game names it by, which display_name reads.

currency_id instance-attribute

currency_id: int

The currency's id, as other tables reference it.

text_id instance-attribute

text_id: str

The text id the game names it by, which display_name reads.

display_name

display_name(lang: str = 'en') -> str

The game's name for it in lang, the text currency_name_<assetName or Name>.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: CollectableItemGenericCurrencyVO.getNameTextId (bundle line 5267)

CurrencyId

Bases: IntEnum

Currency ids from the currencies table, as other tables reference them; names match Currency.

Client: XmlCurrencyVO.parseXml (bundle line 141282)

Methods:

Name Description
display_name

The game's name for it in lang, the text currency_name_<assetName or Name>.

Attributes:

Name Type Description
json_key str

The key the server uses for it, a Currency value.

text_id str

The text id the game names it by, which display_name reads.

json_key instance-attribute

json_key: str

The key the server uses for it, a Currency value.

text_id instance-attribute

text_id: str

The text id the game names it by, which display_name reads.

display_name

display_name(lang: str = 'en') -> str

The game's name for it in lang, the text currency_name_<assetName or Name>.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: CollectableItemGenericCurrencyVO.getNameTextId (bundle line 5267)

DailyQuestId

Bases: IntEnum

Daily quest ids from the dailyactivities table, named from what the first condition counts. Named DailyQuestId, as empire_core.quests.DailyQuest is today's quest.

Client: CastleDailyQuestData.createXmlQuestDic (bundle line 134082), DailyQuestVO.fillFromParamXML (bundle line 134124)

Attributes:

Name Type Description
trigger_kingdom_id int

The kingdom the quest counts in, a Kingdom value; -1 for any.

trigger_kingdom_id instance-attribute

trigger_kingdom_id: int

The kingdom the quest counts in, a Kingdom value; -1 for any.

DaimyoCastle

Bases: IntEnum

Daimyo castle ids from the daimyoCastles table, named from the rank the game names the area by and the level: the Legion of the Daimyos' daimyo castles.

Client: DaimyoXmlVO.parseXML (bundle line 61663), read by DaimyoCastleXmlData (bundle line 141378)

Attributes:

Name Type Description
rank int

Its rank.

level int

Upgrade level; -1 when the row has none.

rank instance-attribute

rank: int

Its rank.

level instance-attribute

level: int

Upgrade level; -1 when the row has none.

DaimyoTownship

Bases: IntEnum

Township ids from the daimyoTownships table, named from the rank the game names the area by and the level: the Legion of the Daimyos' townships.

Client: DaimyoXmlVO.parseXML (bundle line 61663), read by DaimyoTownshipXmlData (bundle line 141400)

Attributes:

Name Type Description
rank int

Its rank.

level int

Upgrade level; -1 when the row has none.

rank instance-attribute

rank: int

Its rank.

level instance-attribute

level: int

Upgrade level; -1 when the row has none.

DifficultyType

Bases: IntEnum

Event difficulty type ids from the eventAutoScalingDifficultyTypes table.

Client: EventAutoScalingDifficultyTypeVO.parseXML (bundle line 38258)

EffectType

Bases: IntEnum

Effect type ids from the effecttypes table.

Client: CastleEffectTypeVO (bundle line 111835)

Effect

Bases: IntEnum

Effect ids from the effects table.

Client: EffectVO.parseXML (bundle line 41702)

Attributes:

Name Type Description
effect_type_id int

The effect type it modifies, an EffectType value.

effect_type_id instance-attribute

effect_type_id: int

The effect type it modifies, an EffectType value.

EquipmentEffect

Bases: IntEnum

Equipment effect ids from the equipment_effects table, the bonuses equipment rolls, named from the effect each gives, its bonus and who wears it.

Client: XmlEquipmentEffectVO.parseXml (bundle line 144264)

Attributes:

Name Type Description
effect_id int

The effect it gives, an Effect value.

bonus int

Its bonus.

wearer_id int

Who wears it, a WearerType value.

effect_id instance-attribute

effect_id: int

The effect it gives, an Effect value.

bonus instance-attribute

bonus: int

Its bonus.

wearer_id instance-attribute

wearer_id: int

Who wears it, a WearerType value.

EquipmentGroup

Bases: IntEnum

Equipment item group ids from the equipment_groups table, as equipment effects name them.

Client: XmlEquipmentGroupVO.parseXml (bundle line 144187)

Attributes:

Name Type Description
wearer_id int

Who wears it, a WearerType value.

slot_id int

The slot it goes in, an EquipmentSlot value.

wearer_id instance-attribute

wearer_id: int

Who wears it, a WearerType value.

slot_id instance-attribute

slot_id: int

The slot it goes in, an EquipmentSlot value.

Event

Bases: IntEnum

Event ids from the events table, named from the title players see, else eventType.

Client: CastleSpecialEventData.storeXmlEvents (bundle line 139777) keys rows by eventID, ASpecialEventVO.parseBasicsFromXmlNode (bundle line 2959) reads eventType

Methods:

Name Description
display_name

The game's name for it in lang, the text event_title_<value>; None when the language file has no such

Attributes:

Name Type Description
text_id str

The text id of its name, event_title_<value>.

text_id property

text_id: str

The text id of its name, event_title_<value>.

display_name

display_name(lang: str = 'en') -> str | None

The game's name for it in lang, the text event_title_<value>; None when the language file has no such text.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: "event_title_" + eventID, as the reward hub, alliance quests and season events name an event (bundle lines 54451, 111097 and 31389)

Feast

Bases: IntEnum

Feast ids from the feasts table, named from the game's English name.

Client: CastlePremiumMarketCollectionData.parseXML (split.js line 34586); names from PremiumFestivalItemVO.nameTextID (split.js line 333269)

Methods:

Name Description
display_name

The game's name for it in lang, the text dialog_festival_<type>Event.

Attributes:

Name Type Description
text_id str

The text id the game names it by, which display_name reads.

text_id instance-attribute

text_id: str

The text id the game names it by, which display_name reads.

display_name

display_name(lang: str = 'en') -> str

The game's name for it in lang, the text dialog_festival_<type>Event.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: PremiumFestivalItemVO.nameTextID (split.js line 333269)

FusionForgeId

Bases: IntEnum

Fusion forge ids from the fusionSystems table, which the fusionForges table shares, named from the game's English name. Named FusionForgeId, as FusionForge is a forge's level and energy.

Client: FusionForgeData.init (bundle line 141977) builds a forge per fusionSystems row; names from FusionForgeHubDialogMainItem.getNameTextId (bundle line 78081)

Methods:

Name Description
display_name

The game's name for it in lang, the text dialog_fusionHub_fusionForges_deco; None for a row without one.

Attributes:

Name Type Description
text_id str

The text id the game names it by, which display_name reads.

text_id instance-attribute

text_id: str

The text id the game names it by, which display_name reads.

display_name

display_name(lang: str = 'en') -> str | None

The game's name for it in lang, the text dialog_fusionHub_fusionForges_deco; None for a row without one.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: FusionForgeHubDialogMainItem.getNameTextId (bundle line 78081)

GemColor

Bases: IntEnum

Gem colour ids from the gemColors table, named from the game's English tooltip for the colour.

Client: GemColorVO.parseXml (bundle line 144489)

Gem

Bases: IntEnum

Gem ids from the gems table, named from the game's English name and, unless unique, level.

Client: CastleGemVO.parseXML (bundle line 28287); names from CastleGemVO.nameString (bundle line 28321)

Methods:

Name Description
display_name

The game's name for it in lang, the text gem_unique_<reuseAssetOfGemID> or gem_effect_name_<gem type>,

Attributes:

Name Type Description
level int

Gem level; 0 for a unique gem.

set_id int

Its set; -1 for none.

text_id str

The text id the game names it by, which display_name reads.

level instance-attribute

level: int

Gem level; 0 for a unique gem.

set_id instance-attribute

set_id: int

Its set; -1 for none.

text_id instance-attribute

text_id: str

The text id the game names it by, which display_name reads.

display_name

display_name(lang: str = 'en') -> str

The game's name for it in lang, the text gem_unique_<reuseAssetOfGemID> or gem_effect_name_<gem type>, its {0} filled with the level.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: CastleGemVO.nameString (bundle line 28321)

GeneralAbility

Bases: IntEnum

General ability ids from the generalAbilities table, one per level.

Client: GeneralAbilityXmlVO.fillFromParamXml (bundle line 113203)

Attributes:

Name Type Description
ability_group_id int

The group the ability's levels share.

level int

Upgrade level; -1 when the row has none.

ability_group_id instance-attribute

ability_group_id: int

The group the ability's levels share.

level instance-attribute

level: int

Upgrade level; -1 when the row has none.

GeneralRarity

Bases: IntEnum

General rarity ids from the generalRarities table, named from name; the client's colours call the third epic (GeneralVO.GENERAL_COLOR_EPIC, bundle line 26790).

Client: GeneralRarityXmlVO.fillFromParamXml (bundle line 113254)

GeneralSkill

Bases: IntEnum

General skill ids from the generalSkills table, named general, skill and level.

Client: GeneralSkillVO.parseXML (bundle line 113363)

Attributes:

Name Type Description
general_id int

The general it belongs to, a General value.

level int

Upgrade level; -1 when the row has none.

general_id instance-attribute

general_id: int

The general it belongs to, a General value.

level instance-attribute

level: int

Upgrade level; -1 when the row has none.

General

Bases: IntEnum

General ids from the generals table.

Client: GeneralXmlVO.fillFromParamXml (bundle line 33102)

Methods:

Name Description
display_name

The game's name for it in lang, the text generals_characters_<value>_name; None when the language file

Attributes:

Name Type Description
rarity_id int

The generalRarityID column.

text_id str

The text id of its name, generals_characters_<value>_name.

rarity_id instance-attribute

rarity_id: int

The generalRarityID column.

text_id property

text_id: str

The text id of its name, generals_characters_<value>_name.

display_name

display_name(lang: str = 'en') -> str | None

The game's name for it in lang, the text generals_characters_<value>_name; None when the language file has no such text.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: GeneralXmlVO.nameTextID (bundle line 33105)

GeneralsHubCharacter

Bases: IntEnum

Generals hub character ids from the characters table, named from name; the client's constants are ID_FAT_KING, ID_KNIGHT and ID_PRINCESS (GeneralsHubQuestVO, bundle line 47051).

Client: GeneralsHubQuestVO.fillFromParamXml (bundle line 47005)

GlobalEffect

Bases: IntEnum

Global effect ids from the globalEffects table.

Client: GlobalEffectVO.parseXml (bundle line 143690)

Horse

Bases: IntEnum

Travel booster wodID values from the horses table, the HBW movements send, named from the comment2 and comment1 notes: the game names a horse only by its button's place in the travel dialog, the tooltip text horse<n>.

Client: HorseTravelboosterVO.parseXmlNode (bundle line 118814); ACastlePostActionDialog.calculateTooltip (bundle line 27269)

Judgement

Bases: IntEnum

Citizen judgement ids from the judgements table, named from the game's English name, else visualName.

Client: JudgementVO.fillFromParamXML (bundle line 134514); names from judgement_<id>_name (bundle line 49629)

Methods:

Name Description
display_name

The game's name for it in lang, the text judgement_<value>_name; None when the language file has no such

Attributes:

Name Type Description
text_id str

The text id of its name, judgement_<value>_name.

text_id property

text_id: str

The text id of its name, judgement_<value>_name.

display_name

display_name(lang: str = 'en') -> str | None

The game's name for it in lang, the text judgement_<value>_name; None when the language file has no such text.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: EventJudgementVO.getInfoTooltipLine1 (bundle line 49629)

LeagueType

Bases: IntEnum

League type ids, the LID of the highscore commands, named from the highscore's title for each league: its level band in the honour highscore. An event numbers its own leagues from 1 too, so in an event a member is that event's league of the id; GameData.league_type gives its band.

Client: LeagueTypeVO.parseXML (bundle line 91495); names from CastleHighscoreDialog.setLeagueTitleById (bundle line 27528)

Methods:

Name Description
display_name

The game's name for it in lang, the text dialog_highscore_league<value>; None when the language file has

Attributes:

Name Type Description
text_id str

The text id of its name, dialog_highscore_league<value>.

text_id property

text_id: str

The text id of its name, dialog_highscore_league<value>.

display_name

display_name(lang: str = 'en') -> str | None

The game's name for it in lang, the text dialog_highscore_league<value>; None when the language file has no such text.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: CastleHighscoreDialog.setLeagueTitleById (bundle line 27528)

LegendarySkill

Bases: IntEnum

Legendary skill ids from the legendskills table, named effect type, tree, group and level.

Client: CastleLegendSkillVO.parseXML (bundle line 48652)

Methods:

Name Description
display_name

The game's name for it in lang, the text dialog_legendTemple_<skill_group_id>_name.

Attributes:

Name Type Description
skill_tree_id int

The tree it sits in.

skill_group_id int

The group its levels share.

level int

Upgrade level; -1 when the row has none.

text_id str

The text id of its name, dialog_legendTemple_<skill_group_id>_name.

skill_tree_id instance-attribute

skill_tree_id: int

The tree it sits in.

skill_group_id instance-attribute

skill_group_id: int

The group its levels share.

level instance-attribute

level: int

Upgrade level; -1 when the row has none.

text_id property

text_id: str

The text id of its name, dialog_legendTemple_<skill_group_id>_name.

display_name

display_name(lang: str = 'en') -> str

The game's name for it in lang, the text dialog_legendTemple_<skill_group_id>_name.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: CastleLegendSkillVO.nameTextID (bundle line 48669)

LootBoxType

Bases: IntEnum

Loot box type ids from the lootBoxTypes table, named from lootBoxTheme; keys count per type.

Client: LootBoxTypeVO.parseXML (bundle line 58900)

LootBox

Bases: IntEnum

Loot box ids from the lootBoxes table, named name and rarity.

Client: LootBoxVO.parseXML (bundle line 112502)

Attributes:

Name Type Description
rarity int

The rarity column.

rarity instance-attribute

rarity: int

The rarity column.

MainQuest

Bases: IntEnum

Main quest ids from the mainquests table, the quest book's chapters, named from the game's English title.

Client: CastleQuestBookMainQuestListVO.parseListsFromParamObject (bundle line 52419); names from mainquest_<id>_title (bundle line 93386)

Methods:

Name Description
display_name

The game's name for it in lang, the text mainquest_<value>_title.

Attributes:

Name Type Description
text_id str

The text id of its name, mainquest_<value>_title.

text_id property

text_id: str

The text id of its name, mainquest_<value>_title.

display_name

display_name(lang: str = 'en') -> str

The game's name for it in lang, the text mainquest_<value>_title.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: the quest book's chapter dialog (bundle line 93386)

PrebuiltCastle

Bases: IntEnum

Prebuilt castle ids from the prebuiltcastles table: the castles and camps a kingdom, a season event's map or a special server starts with, named from the game's English name and the area offering it.

Client: PrebuiltCastleItemVO.parseXML (bundle line 142341)

Methods:

Name Description
display_name

The game's name for it in lang, the text ``dialog_chooseCastle_preBuiltCastle_ or

Attributes:

Name Type Description
text_id str

The text id the game names it by, which display_name reads.

text_id instance-attribute

text_id: str

The text id the game names it by, which display_name reads.

display_name

display_name(lang: str = 'en') -> str | None

The game's name for it in lang, the text dialog_chooseCastle_preBuiltCastle_<id> or dialog_prebuiltCastle<id>_name; None for a row without one.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: SpecialServerPreBuiltCastleVO.getNameText (bundle line 40294) and CastleKingdomCastleDetails.update (bundle line 97888)

PrivateVillageType

Bases: IntEnum

Private resource village ids from the privateVillages table, one per kind, kingdom and level, named from the game's English name. Named PrivateVillageType, as PrivateVillage is one you hold.

Client: PrivateResourceVillageInfoVO.fillFromParamXML (bundle line 143715)

Methods:

Name Description
display_name

The game's name for it in lang, the text dialog_privateResourceVillages_villageLevel_<resource>_tt, its

Attributes:

Name Type Description
kingdom_id int

Its kingdom, a Kingdom value.

resource str

What it produces: wood, stone or food.

level int

Upgrade level; -1 when the row has none.

text_id str

The text id of its name, dialog_privateResourceVillages_villageLevel_<resource>_tt.

kingdom_id instance-attribute

kingdom_id: int

Its kingdom, a Kingdom value.

resource instance-attribute

resource: str

What it produces: wood, stone or food.

level instance-attribute

level: int

Upgrade level; -1 when the row has none.

text_id property

text_id: str

The text id of its name, dialog_privateResourceVillages_villageLevel_<resource>_tt.

display_name

display_name(lang: str = 'en') -> str

The game's name for it in lang, the text dialog_privateResourceVillages_villageLevel_<resource>_tt, its {0} filled with the level.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: PrivateResourceVillageShopItem.getTitleTxt (bundle line 81659)

QuestId

Bases: IntEnum

Quest ids from the quests table, named from what the first condition counts; most names carry their id, as many quests count the same thing. Named QuestId, as empire_core.quests.Quest is your running quest.

Client: CastleQuestData.generateQuestXMLList (bundle line 20192), CastleQuestVO.fillFromParamXML (bundle line 52452)

Attributes:

Name Type Description
series_id int

The quest series it belongs to; -1 for none.

event_id int

The event it belongs to, an Event value; 0 for none.

series_id instance-attribute

series_id: int

The quest series it belongs to; -1 for none.

event_id instance-attribute

event_id: int

The event it belongs to, an Event value; 0 for none.

RaidBoss

Bases: IntEnum

Alliance raid boss ids from the raidBosses table.

Client: AllianceRaidbossVO.parseXML (bundle line 113835)

Research

Bases: IntEnum

Research ids from the researches table, named from the game's English title and level; a blueprint or recipe research from the comment2 note, group and level.

Client: AResearchVO.fillFromParamXML (bundle line 61502), which does not read comment2; titles from ResearchVO.nameTextId (bundle line 61480)

Methods:

Name Description
display_name

The game's name for it in lang, the text research_<groupID>_title or ci_blueprint_<item name>; None for

Attributes:

Name Type Description
group_id int

The group the research's levels share.

level int

Upgrade level; -1 when the row has none.

text_id str

The text id the game names it by, which display_name reads.

group_id instance-attribute

group_id: int

The group the research's levels share.

level instance-attribute

level: int

Upgrade level; -1 when the row has none.

text_id instance-attribute

text_id: str

The text id the game names it by, which display_name reads.

display_name

display_name(lang: str = 'en') -> str | None

The game's name for it in lang, the text research_<groupID>_title or ci_blueprint_<item name>; None for a row without one.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: ResearchVO.nameTextId (bundle line 61480), BlueprintResearchVO.nameTextId (bundle line 139596); a crafting recipe research has none here, as its name holds its recipe's output (CraftingRecipeResearchVO.fullNameText, bundle line 139405)

SceatSkill

Bases: IntEnum

Sceat skill ids from the sceatSkills table, named from the game's English name and level.

Client: CastleSceatSkillVO.parseXML (bundle line 23074); names from nameTextID (bundle line 23110)

Methods:

Name Description
display_name

The game's name for it in lang, the text dialog_legendTemple_sceat_<skill_group_id>_name.

Attributes:

Name Type Description
skill_group_id int

The group its levels share.

skill_tree_id int

The tree it sits in.

level int

Upgrade level; -1 when the row has none.

text_id str

The text id of its name, dialog_legendTemple_sceat_<skill_group_id>_name.

skill_group_id instance-attribute

skill_group_id: int

The group its levels share.

skill_tree_id instance-attribute

skill_tree_id: int

The tree it sits in.

level instance-attribute

level: int

Upgrade level; -1 when the row has none.

text_id property

text_id: str

The text id of its name, dialog_legendTemple_sceat_<skill_group_id>_name.

display_name

display_name(lang: str = 'en') -> str

The game's name for it in lang, the text dialog_legendTemple_sceat_<skill_group_id>_name.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: CastleSceatSkillVO.nameTextID (bundle line 23110)

Title

Bases: IntEnum

Title ids from the titles table, named from the game's English title.

Client: TitleVO.parseXml (bundle line 62705); names from TitleVO.textID (bundle line 62756)

Methods:

Name Description
display_name

The game's name for it in lang, the text playerTitle_<value>.

Attributes:

Name Type Description
title_system str

Its title system, a TitleSystem value.

text_id str

The text id of its name, playerTitle_<value>.

title_system instance-attribute

title_system: str

Its title system, a TitleSystem value.

text_id property

text_id: str

The text id of its name, playerTitle_<value>.

display_name

display_name(lang: str = 'en') -> str

The game's name for it in lang, the text playerTitle_<value>.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: TitleVO.textID (bundle line 62756)

Tool

Bases: IntEnum

Tool wodID values from the units table (rows with slotTypes).

Client: ToolUnitVO.parseXmlNode (bundle line 6538)

Methods:

Name Description
display_name

The game's name for it in lang, the text <type>_name.

Attributes:

Name Type Description
level int

Upgrade level; -1 when the row has none.

category str

Attack or Defence; "0" when the row has none.

text_id str

The text id the game names it by, which display_name reads.

level instance-attribute

level: int

Upgrade level; -1 when the row has none.

category instance-attribute

category: str

Attack or Defence; "0" when the row has none.

text_id instance-attribute

text_id: str

The text id the game names it by, which display_name reads.

display_name

display_name(lang: str = 'en') -> str

The game's name for it in lang, the text <type>_name.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: BasicUnitVO.getNameString (bundle line 19219)

TreasureMapId

Bases: IntEnum

Treasure map ids from the tmaps table: the season events' maps and the treasure hunt's, named from the game's English title; a season map by its event's in-game name and its comment1 difficulty; else the comment2 and comment1 notes.

Client: TreasureMapVO.fillFromParamXML (bundle line 140567); names from CastleTreasureMapDialog.onMapLoaded (bundle line 43848), a season map's event from the events' mapID (ASeasonEventVO.parseEventXmlNode, bundle line 31385)

Methods:

Name Description
display_name

The game's name for it in lang, the text treasuremap_chest_<value>_title; None when the language file

Attributes:

Name Type Description
map_type int

What the map is for, a TreasureMapType value.

text_id str

The text id of its name, treasuremap_chest_<value>_title.

map_type instance-attribute

map_type: int

What the map is for, a TreasureMapType value.

text_id property

text_id: str

The text id of its name, treasuremap_chest_<value>_title.

display_name

display_name(lang: str = 'en') -> str | None

The game's name for it in lang, the text treasuremap_chest_<value>_title; None when the language file has no such text.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: "treasuremap_chest_" + currentMapID + "_title", as CastleTreasureMapDialog.onMapLoaded names the treasure hunt's map (bundle line 43848)

Unit

Bases: IntEnum

Unit wodID values from the units table (rows without slotTypes).

Client: SoldierUnitVO.parseXmlNode (bundle line 12531)

Methods:

Name Description
display_name

The game's name for it in lang, the text <type>_name.

Attributes:

Name Type Description
level int

Upgrade level; -1 when the row has none.

role str

melee or ranged.

text_id str

The text id the game names it by, which display_name reads.

level instance-attribute

level: int

Upgrade level; -1 when the row has none.

role instance-attribute

role: str

melee or ranged.

text_id instance-attribute

text_id: str

The text id the game names it by, which display_name reads.

display_name

display_name(lang: str = 'en') -> str

The game's name for it in lang, the text <type>_name.

Fetches the language file on first use and caches it (empire_core.texts.text); a text the file lacks, or a failed fetch, gives the text id.

Client: BasicUnitVO.getNameString (bundle line 19219)

is_current

is_current(game_data: GameData | None = None) -> bool

Whether game_data is the items version these enums were generated from.