Items
Items are a per-player inventory of consumable stacks. Unlike medals and spins, which are running totals on your player record, an item sits in your inventory until you choose to use it — and using one is what actually pays out its effect.
The kinds
Every item in the catalog is exactly one of these kinds. Which items a realm actually ships, and what each one pays, is realm configuration — read the catalog endpoint rather than hardcoding this table.
| Kind | What using it does |
|---|---|
resource_chest | Adds a fixed resource bundle to a town you choose, capped at that town’s storage limits — the same cap a quest or wheel resource prize respects. |
medal_bundle | Adds a fixed bundle of named medals (medal_id -> count) to your inventory. |
medal_box | Adds a range of each of several named medals — the Junior/Medium/Senior Medal Boxes’ “2 to 4 each”, once per box opened. The amount is not random. |
troop_chest | Adds a range of each of several unit types straight into a town you choose — the Junior and Senior Battalions. The troops are yours immediately, and so is their food upkeep. Deliberately not limited by the town’s population capacity — see there for what that costs. |
hero_xp | Adds experience to a hero you choose: the greater of a flat amount and a fraction of what that hero needs for its next level. |
hero_reset | Holy Water: refunds every attribute point you have allocated to a hero, back into its unspent pool, leaving its recruit-time base attributes alone. The quantity needed is fixed by the hero — see Holy Water. Refused if the hero has nothing allocated. |
inn_refresh | Hero Hunting: rerolls a town Inn’s hire list for free, exactly as the gold-priced refresh does. |
population_boost | Civil Code: instantly adds population to a town you choose — a fraction of that town’s population capacity, or a floor, whichever is greater. A town already at capacity is refused. |
trade_instant | Merchant Fleet: lands an accepted trade caravan now. Either party to the trade may use it; delivery itself still happens on the next resolver tick. |
alliance_pact | Ritual of Pact: raises your alliance’s member limit to the realm’s ceiling, lifting the Embassy gate. Alliance Host only. |
town_buff | Opens a timed window on a town you choose — War Horn and Ivory Horn (+troop attack from that town), Corselet and Ultra Corselet (+troop defence there), Penicillin (more of that town’s battle dead become hospital wounded instead), the eight produce boosters (+production of one resource), Tax Policy and Adv Tax Policy (double tax revenue; the advanced one also freezes loyalty from falling). See Timed buffs. |
war_ensign | Arms a town so its next attack march may send 25% more troops than its Rally Spot normally allows, then disarms. See The War Ensign. |
hero_buff | Opens a timed window on one hero, raising one of its attributes by a fraction of its value. The hero’s own stat never changes; the bonus applies while the window is open and vanishes when it closes. |
speedup | Brings one queued order forward: a building upgrade, a research level or a wall-fortification build. Each item names which of those queues it may shorten, and takes off either a fixed number of seconds, a draw from a published range, or a fraction of the time still remaining. A Speed Up item never consumes the paid speedup’s per-order use limit. See Speed Up items. |
spin_token | Grants fortune wheel spins. |
loyalty_reset | Instantly resets a town you choose to loyalty: 100 and grievance: 0 — see Population, Tax, and Loyalty. |
building_permit | Cannot be used through this endpoint — POST /items/{item_id}/use on one always 400s. It is spent automatically instead, by upgrading a Cottage or Town Hall to level 10. |
truce | Puts you under a truce for the realm’s truce window: nobody can attack you, and you can attack nobody but barbarian settlements. See Truces. |
Each catalog item names exactly one kind and carries only the payload that
kind needs. Several kinds carry no payload at all — hero_reset,
inn_refresh, trade_instant, alliance_pact, war_ensign,
loyalty_reset, building_permit and truce — because their effect is
fixed by the engine or by realm-wide settings (the truce window, the
alliance ceiling) rather than configured per item, so two copies of the same
item can never disagree about what they do.
Ranges are not random
A medal_box or a troop_chest pays somewhere inside a published range —
“2 to 4 Cross Medals”, “100 to 250 Workers”. That number is not random.
It is derived, exactly like a wheel spin, from your
player id, the item, and how many of that item you have used. Two
different medals in one box draw independently, so a box never pays three
identical counts by accident.
Being derived, it is also predictable: with the published rule you can work out every future draw of every item you hold. That is fine, and deliberate — the point of the construction is not secrecy but that the server cannot cheat. What you cannot do is choose among your draws. Two things make that true, and both are worth knowing:
- Each item has its own sequence. The only thing that advances a given item’s draws is spending that item. Using a Holy Water does not move your next Junior Battalion, so there is no order to shop for. It is the same rule the wheel follows: the only way to reach the next spin is to take the current one.
- Every unit draws separately. Opening three boxes in one call is three independent draws, summed — exactly what opening them one at a time pays. So there is no way to split or group a stack to land on the good numbers, and a stack you empty and later refill carries on from where it stopped rather than replaying its first draw.
Holy Water quantities
Holy Water is the one item whose quantity you do not choose. Resetting a hero
costs 1 + level / 10 of them, rounded down — one for a level 1-9 hero, two
at level 10, three at level 20, and so on. Sending any other number is a
400 that names the right one, so nothing is ever spent for nothing.
A reset refunds only points you allocated; a hero’s recruit-time base attributes are untouched, and the refunded points go straight back into its unspent pool to redistribute.
Timed buffs
A town_buff or a hero_buff does not pay out and finish; it opens a
window. While that window is open the effect counts everywhere it is
read, and the moment it closes it stops counting — nothing has to be
claimed, expired or swept.
Four rules govern them, and all four are deliberate:
- Using one again EXTENDS the window. A second War Horn on the same
town adds another 24 hours to whatever is left, rather than making the
bonus bigger. So
quantity: 3is exactly three separate uses — three durations — which is the same equality the ranged items keep. - Two different items that raise the same thing do not add up. A Corselet (+20% defence, 24h) and an Ultra Corselet (+20% defence, 7 days) held together are +20%, not +40%: the larger magnitude wins, and the pair is a duration upgrade rather than a stacking one. The same goes for two production boosters on one resource, or two hero books on one attribute.
- A window ends the instant it expires. An expiry timestamp of exactly “now” is already closed — the window is half-open, so “24 hours” means the 24 hours after you used it and not one moment more.
- What accrues over time is prorated, so you never have to be watching. Production, tax and the loyalty freeze are all settled against a stretch of time that has already passed, and a buff is credited for exactly the part of that stretch it covered — and so is a mayor’s Politics under a hero book. It never reaches backwards over the hours before you used it, and it stops paying the moment it lapses — but a 24-hour booster used and then forgotten about for a week still pays its full 24 hours. (A combat buff is different by nature: a battle happens at an instant, so it either applies or it does not.)
- Magnitudes live in the catalog, never on your town. Your town records only which items are running and until when; what each one does is read from the realm’s catalog every time. A realm that retunes a booster retunes it for everyone immediately, and your town can never disagree with the published table.
Your active windows are published on each town in
GET /api/v1/state/ as buffs — a map of item_id to
the expiry timestamp — and on each hero in GET /api/v1/heroes/ the same
way. Only open windows appear; a closed one is simply gone from the map.
Buffs on opposite sides of a battle do not cancel each other out. The corpus these items come from describes a War Horn as “nullified by” a Corselet; restfall does not model that as a special case — the attacker’s +20% and the defender’s +20% both apply, and simply offset. See Attacks.
The War Ensign
The War Ensign is the one item that is neither instant nor timed: using it arms a town. The next attack march that town dispatches may send 25% more troops than its Rally Spot troop cap normally allows, and the ensign is then spent.
Two things follow from “the next attack march”:
- It is spent whether or not the extra room mattered. The banner is raised when the army musters, not when the cap bites, so a small attack march consumes it just as a maximal one does.
- Support, scout and founding marches neither use it nor spend it. Only an attack does either.
It raises the troop cap only — never the number of marches a Rally Spot
lets you have in flight at once. A town that already has one raised refuses
a second with a 409 rather than burning it, and war_ensign_ready on each
town in GET /api/v1/state/ says whether one is up.
Speed Up items
A speedup item brings one queued order forward. Six Guidelines, Napoleon’s
Diary and Archimedes’ Note ship in the free and fast realms, and between
them they cover the game’s three speed-up-able queues (troop training is not one of them, see below):
| Item | Takes off | Queues it may shorten |
|---|---|---|
| Beginner Guidelines | 15 minutes | building, research |
| Primary Guidelines | 1 hour | building, research |
| Intermediate Guidelines | 2.5 hours | building, research |
| Senior Guidelines | 8 hours | building, research |
| Master Guidelines | between 10 and 30 hours | building, research |
| Ultimate Guidelines | 30% of the time remaining | building, research |
| Napoleon’s Diary | 30% of the time remaining | building, research — once per order |
| Archimedes’ Note | 30% of the time remaining | wall fortifications — once per order |
Four rules are worth knowing before you spend one:
- An item ignores the paid speedup’s use limit.
speedup_max_usesgoverns the resource-priced speedup alone, so Guidelines stack freely on a single order and a spent resource speedup never locks them out. - A fraction is of what is left, measured when you use it. Ultimate Guidelines on a 40-hour upgrade you have just started takes off 12 hours; on the same upgrade with an hour to go it takes off 18 minutes. Long job, used early.
- Master Guidelines’ draw is not random, like every other range in this catalog.
- Once per order means forever. Napoleon’s Diary and Archimedes’ Note
each record themselves on the order they shorten; a second one on the same
construction, research level or queued fortification is a
409and is not spent. A different order takes one normally. - Training can never be sped up. No item shortens a troop-training order
and neither does a resource speedup: a
training_idtarget is a400withTraining cannot be sped up., whatever the item, and a realm’s config is rejected at load if an item namestrainingas a target. A training order always runs its full timer.
An item pointed at a queue it does not name — a Guideline at a wall
fortification, an Archimedes’ Note at a building — is a 400, not a silent no-op, and
speedup_targets on the catalog is where each item’s list is
published. Order ids come from GET /api/v1/state/ (a building’s
upgrade_id), GET /api/v1/research/ and
GET /api/v1/fortifications/queue respectively.
Your inventory
GET /api/v1/items/Authorization: Bearer <player_token>Your inventory has its own endpoint; it is not part of the game state poll. It only changes when you use an item or one is granted to you, so read it far less often than you poll state — and read it again right after the action that changes it: using an item (the use response already echoes the new inventory, so there is no need to re-read after that one), claiming a quest, spinning the wheel, or clearing a barbarian settlement.
{ "count": 2, "limit": 50, "offset": 0, "results": [ { "item_id": "small_wood_chest", "name": "Small Wood Chest", "kind": "resource_chest", "description": "A modest cache of timber.", "quantity": 2 }, { "item_id": "speedup_1h", "name": "1-Hour Speedup", "kind": "speedup", "description": "", "quantity": 1 } ]}Items of the same catalog id stack into a single entry with a quantity —
there is no per-unit identity, and a stack disappears from the list entirely
once its quantity reaches zero. Stacks are listed in the realm’s catalog
order. The envelope is the standard limit/offset page every list
endpoint uses; an inventory is bounded by the catalog size, so the first
page is normally the whole of it.
import httpx
response = httpx.get( "http://localhost:8731/api/v1/items/", headers={"Authorization": "Bearer your-token-here"},)for stack in response.json()["results"]: print(stack["item_id"], stack["quantity"])curl http://localhost:8731/api/v1/items/ \ -H "Authorization: Bearer your-token-here"const response = await fetch("http://localhost:8731/api/v1/items/", { headers: { Authorization: "Bearer your-token-here" },});const { results } = await response.json();Using an item
POST /api/v1/items/{item_id}/useAuthorization: Bearer <player_token>{ "quantity": 1, "target": null }target is only required for the kinds that need one. The
catalog publishes which, per item, as a target of town,
hero, trade, speedup_order or null:
| Kind | target |
|---|---|
resource_chest, loyalty_reset, troop_chest, inn_refresh, population_boost, town_buff, war_ensign | { "town_id": "..." } — one of your towns. |
hero_xp, hero_reset, hero_buff | { "hero_id": "..." } — one of your heroes. A captured hero is out of your reach (and governs no town: a captured mayor was unseated by the capture). |
trade_instant | { "trade_id": "..." } — an accepted, undelivered trade you are a party to. |
speedup | Exactly one of { "building_upgrade_id": ... }, { "research_id": ... } or { "fortification_id": ... } — the queued order to shorten, and it must be a queue this item names in its speedup_targets. |
medal_bundle, medal_box, spin_token, truce, alliance_pact | Omit target entirely — these apply straight to your player record, or to the alliance you host. |
building_permit | N/A — never usable through this endpoint (see the kinds table above). |
quantity defaults to 1 and may open several of a stack at once. A ranged
item rolls once per unit, so quantity: 3 pays exactly what three
separate uses pay. The exceptions are the kinds the catalog marks
single_use, which must be exactly 1:
speedup, loyalty_reset, truce, inn_refresh, population_boost,
trade_instant, alliance_pact and war_ensign. Each of those targets one
thing once — a queued order, a town’s loyalty, your lord’s peace, an Inn’s
list, a town’s headroom, one caravan, one alliance, one town’s raised
banner — so “use 3” has no meaning for any of them. The two timed kinds are
the opposite case: quantity: 3 on a town_buff or a hero_buff extends
the window by three durations, which is exactly what three separate uses do. hero_reset is the exception in the other direction: its quantity is
fixed by the hero’s level.
import httpx
response = httpx.post( "http://localhost:8731/api/v1/items/small_wood_chest/use", headers={"Authorization": "Bearer your-token-here"}, json={"quantity": 1, "target": {"town_id": "your-town-uuid"}},)print(response.json())curl -X POST http://localhost:8731/api/v1/items/small_wood_chest/use \ -H "Authorization: Bearer your-token-here" \ -H "Content-Type: application/json" \ -d '{"quantity": 1, "target": {"town_id": "your-town-uuid"}}'const response = await fetch("http://localhost:8731/api/v1/items/small_wood_chest/use", { method: "POST", headers: { Authorization: "Bearer your-token-here", "Content-Type": "application/json", }, body: JSON.stringify({ quantity: 1, target: { town_id: "your-town-uuid" } }),});const result = await response.json();The response reports what the item did in applied, and your inventory
after consumption in items — the same stacks, in the same order,
GET /api/v1/items/ would return, so a client that
applies this needs no follow-up read:
{ "items": [ { "item_id": "small_wood_chest", "name": "Small Wood Chest", "kind": "resource_chest", "description": "A modest cache of timber.", "quantity": 1 } ], "applied": { "resources": { "wood": 500 } }}applied shapes by kind:
| Kind | applied |
|---|---|
resource_chest | {"resources": {...}} |
medal_bundle, medal_box | {"medals": {"cross": N, ...}} — the named medals actually granted |
troop_chest | {"units": {...}, "town_id": "..."} |
hero_xp | {"hero_id": "...", "experience": N, "hero_experience": N} |
hero_reset | {"hero_id": "...", "stat_points": N, "refunded": N, "politics": N, "attack": N, "intelligence": N} |
inn_refresh | the town’s new Inn hire list — the same shape GET /api/v1/towns/{town_id}/hero-candidates/ returns |
population_boost | {"town_id": "...", "population": N, "gained": N, "population_capacity": N} |
trade_instant | {"trade_id": "...", "arrives_at": "..."} |
alliance_pact | {"alliance_id": "...", "pact_member_limit": N} |
town_buff | {"town_id": "...", "buffs": {item_id: until}, "until": "..."} — the town’s whole active buff map, and this item’s new expiry |
war_ensign | {"town_id": "...", "war_ensign_ready": true} |
hero_buff | {"hero_id": "...", "buffs": {item_id: until}, "until": "...", "hero_stat": "attack"} |
speedup | {"finished_at": "...", "reduced_seconds": N, "speedup_target": "research"} — the order’s new finish time, how many seconds were actually taken off (less than the item promises when the order had less time left than that), and which queue it was |
loyalty_reset | {"loyalty": 100, "grievance": 0} |
spin_token | {"spins": N} |
truce | {"truce_until": "...", "truce_cooldown_until": "..."} |
Every use also writes an item_used event to your event log,
recording the item, the quantity and what it paid — so a roll can always be
checked after the fact.
Errors
| Status | Cause |
|---|---|
400 | A kind that needs a target used without one; speedup used with no target id or more than one, or pointed at a queue the item does not name; speedup aimed at a troop-training order (training_id), which is always refused with Training cannot be sped up.; a single_use kind used with quantity other than 1; hero_reset used with the wrong quantity for the hero’s level (the message names the right one), or on a hero with nothing allocated to refund; building_permit used at all; population_boost on a town already at its population capacity; hero_xp/hero_reset on a captured hero; inn_refresh on a town with no completed Inn; alliance_pact while you are in no alliance; truce used while a truce is already running, during the truce cooldown, or while you have troops marching |
403 | Season is inactive or has ended; alliance_pact used by anyone but the alliance Host |
404 | Unknown item_id; you do not own a stack of this item; a target you specified is not yours or does not exist — a foreign town, a hero that is not yours, a trade you are not a party to (or one that is not an undelivered caravan), a queued order that is not yours, already finished, or merely waiting for the next resolver tick; alliance_pact on an alliance that was disbanded while the item was being used (nothing is spent) |
409 | quantity is outside [1, quantity you own]; another use of the same item completed while this one was being applied (retry — nothing was spent); alliance_pact on an alliance that already holds a pact; war_ensign on a town that already has one raised; a once_per_order speedup (Napoleon’s Diary, Archimedes’ Note) on an order it has already been applied to |
A refused use changes nothing: the item is not spent, and whatever the handler had already worked out is discarded with the request.
The catalog
GET /api/v1/items/catalogAuthorization: Bearer <player_token>Every item this realm defines, in catalog order, with what it does and every way it can be earned. It is a pure read of the realm’s configuration — it touches no database table at all — so read it once when your client starts and keep it for the session; only a new season can change it.
[ { "item_id": "junior_medal_box", "name": "Junior Medal Box", "kind": "medal_box", "description": "2 to 4 each of Cross, Rose and Lion Medals.", "target": null, "single_use": false, "medal_ranges": { "cross": { "min": 2, "max": 4 }, "rose": { "min": 2, "max": 4 }, "lion": { "min": 2, "max": 4 } }, "sources": { "wheel": [ { "prize_id": "junior_medal_box_prize", "weight": 690, "total_weight": 100000, "quantity": 1 } ], "npc_drops": [], "quests": [] } }]sources is the no-pay-to-win promise made checkable in one request:
wheel— the fortune wheel rows that pay this item, each with itsweightout of the table’stotal_weight. Those are the real odds, the same onesGET /api/v1/wheel/publishes.npc_drops— the barbarian-clear drop tiers that can pay it:chancethat a clear atmin_levelor above drops anything at all, and this item’sweightof the tier’stable_weightonce it does.quests— the quests whose reward includes it.
An item with all three empty is simply unobtainable this season. Nothing in Restfall is ever sold, so there is no fourth list.
Where items come from
Items reach your inventory from four sources — there is no purchase path, matching the same rule spins follow:
-
System and event grants. An admin can grant any player any catalog item directly:
POST /api/v1/items/grant{ "player_id": "target-player-uuid", "item_id": "small_wood_chest", "quantity": 1 }Admin-only, with the admin’s account token from password login (
403for anyone else, and for a realm or OAuth token); resolved against the target player’s own realm and season. -
The fortune wheel. A wheel prize can be an
itemkind alongsideresourcesandmedals— see Fortune Wheel for the full prize shape. -
Quests. A quest’s reward can include items on top of its resource reward — see Quests for the claim mechanics and Quest Lines for the full catalog. In the shipped realms:
- Guidelines (Beginner/Primary/Intermediate/Senior) come from the
promotionline — every rank and title quest pays a pair — and thestarterline’s building quests (a Beginner Guidelines each). - Production boosters (Plowshares, Arch Saw, Quarrying Tools,
Blower, War Horn, Corselet, Penicillin) come from the
wealthyline’s first rung per resource and thevalleysline’s first three rungs. - Holy Water, Truce Agreement and Merchant Fleet come from
the
heroes/domain/starterlines respectively, among other items the day-onewelcome_packagequest pays in full (see Quest Lines). - The Wealth of Nations has exactly one earned source: the
heroesline’s castellan quest (appoint a hero as a town’s mayor).
- Guidelines (Beginner/Primary/Intermediate/Senior) come from the
-
Clearing a barbarian settlement. Beating a settlement’s manned garrison can drop an item, with the odds and the item scaling with the settlement’s level — see Barbarian Settlements. Raiding another player’s town never drops items — a PvP raid pays out looted resources only, exactly as it always has.
Each realm configures its own catalog and which of these sources are wired
up; a realm may use none of them. None of these grants is pushed to you —
re-read GET /api/v1/items/ after the action, or on
your inventory’s own slow cadence for the drops that happen while you are
away.
The Items screen
In the web client, Items is a global command-grid
icon — it opens your whole inventory regardless of which town you’re looking
at, the same way Wheel and Titles do. The client re-reads your inventory
every minute in the background and the moment you open the screen, so
what you see is current without it riding on the game-state poll. It also
fetches the catalog once, on open — every picker below reads
a card’s target/single_use straight off that response rather than
switching on the kind, so a realm that reconfigures what a kind needs shows
up correctly with no client update.
Each card shows the item’s name, kind, description and quantity, with a
picker that matches its catalog target:
- A town card (
resource_chest,loyalty_reset,troop_chest,inn_refresh,population_boost,town_buff,war_ensign) lets you pick which of your towns receives it. - A hero card (
hero_xp,hero_reset,hero_buff) lets you pick one of your heroes, listed as “Name (Lv.N) — Town” and excluding any hero currently held captive. For a Holy Water (hero_reset) card, choosing a hero also pre-fills the quantity field with the exact count that hero’s level needs — the server still enforces the number itself. - A trade card (
trade_instant, i.e. Merchant Fleet) lets you pick one of your accepted, undelivered caravans, labelled by what it carries each way (“400 wood → 100 gold”). - A speedup card lets you pick a queued order to apply it to. The picker lists every order across all of your towns that this particular item may shorten — building upgrades, research and wall fortifications, grouped by queue — so a Guideline never offers you a fortification and Archimedes’ Note never offers you a build. Training orders are never offered.
- A card with no target (
medal_bundle,medal_box,spin_token,alliance_pact,truce) has nothing to pick. Asingle_usecard of any target shape (inn_refresh,population_boost,trade_instant,alliance_pact,war_ensign,loyalty_reset,truce) hides the quantity field entirely and opens exactly one; every other card’s quantity field defaults to1and opens that many, capped at the stack you hold.
The screen’s header also shows your current medal and spin totals, since those are exactly what a bundle or token pays into.
Active effects
Above the inventory grid, an Active effects strip lists every
timed town buff, timed hero buff and armed
War Ensign currently running across all of your towns and
heroes — the item’s name, which town or hero holds it, and a live countdown
to when it closes (or, for an armed Ensign, that it is ready for the town’s
next attack). It reads nothing new: the same buffs and war_ensign_ready
fields GET /api/v1/state/ already publishes on every
town and hero, filtered to windows that are still open. The strip is empty
whenever nothing is running, and a window that closes simply drops off it on
the next poll — nothing to dismiss or acknowledge.