Pascal's Wager Wiki

Almost everything an enemy leaves behind is decided by one small routine: a weighted pick inside a drop group. Each enemy row in the data names one or more drop groups, and each group is a short list of items with weights. The game picks at most one entry per group when the enemy dies. This article explains the lists, the chances, the first-kill and sanity variants, the talent bonus and the maze version. For the wider rules of the world see World mechanics.

Overview#

SourceColumn / tableWhen it is rolledWhere the item goes
Normal killDropId in StoryMonster (several groups separated by ;)On death of a non-Arcade, non-boss-time-challenge enemyLies on the ground within 0.5 m of the corpse
First killFirstDropId + FirstDropCompleteQuestIdOnly the first time that quest flag is unsetSame as a normal kill, but replaces the whole DropId list
Sanity killSanDropIdOnly if the active hero's sanity is not in the normal state at the moment of the killStraight into the bag
Key itemStoryItemIdA fixed scene item is moved to the corpsePick-up item at the corpse
Viola ammoHero 10002 ruleEvery killGround pick-up
Maze enemy / crateStoryMazeDropOn death or when a crate opensGround
Heggie stashGroup 99998After a death, with a special trophy equippedGround

All "item groups" for the main game live in ItemDropData. Its 874 rows form 187 groups, keyed by story id (1-7, 9 and 499) and DropId. Arcade stories (1001-1007) have no rows in this table, so nothing is rolled there (inferred from the lookup by story id).

How a group is rolled#

Every row has four sets of columns, one per journey (journey 1 is the first run, up to journey 4): ItemId_n, Num1_n, Num2_n, Prob_n, ProbAdd1_n, ProbAdd2_n. When a journey starts the game copies the columns of that journey into the live row, so a group can change contents between journeys. In 51 rows the item itself changes with the journey (for example a throwable is replaced by a stronger one); the weights keep the same total in every journey for all 187 groups.

The roll works like this:

  1. Go through the rows of the group. A row with an item id of 0 means "nothing"; it only adds its weight to the total.
  2. A row with a real item is skipped if it is a Health Potion type and your potion count is already full, or the second recovery type (item type 202, "MpRecovery" in the code) and that count is full. A skipped row adds nothing to the total, so the other entries become more likely.
  3. For the remaining items the weight is Prob, plus the bonus from the Lucky Madness talent (below).
  4. A random whole number from 1 to the total is drawn. The game walks down the list of real items adding weights; the first item whose running sum reaches the number wins. If the number is larger than the sum of all real items (it falls into the "nothing" part), no item drops.
  5. The amount is a random whole number between Num1 and Num2, inclusive.

Because "nothing" is never part of the walk, its weight only matters through the total. Lowering the total (for example by a full potion count) or raising it (by a talent bonus) changes every item's share.

Seventeen of the 187 groups do not sum to 100 in journey 1: four total 95, three total 115, two total 90, and one each totals 91, 110 and 124. A further five groups (story 499) have far larger weight totals (1700 to 2320). The total is the same in all four journeys for every group. The roll uses the real total, so the printed weights are not always percentages.

Worked example: a Viola-type group#

Group 10002 of story 1 in journey 1: nothing 26, Miner's Claw 6, Miner's Shell 6, Broken Arrow 6, Broken Bone Spur 6 (1-2 pieces), a throwable (50, 1-2 pieces). Total 100.

  • Chance of one specific material: 6 %. Chance of any material: 24 %. Chance of the throwable: 50 %. Chance of nothing: 26 %.
  • Each of the four materials is of a type that Terrence's Lucky Madness talent covers (item types 701 and 706, see below). The materials in the other example groups below are not all covered: Ruptured Tail is a potion material (702) and Active Sendril a medicine stone (802), both of which are Benita's types. At talent level 1 each material weight becomes 6 + 5 = 11, the throwable stays 50, nothing stays 26. The total becomes 120, so one material is 9.2 % (11/120), any material is 36.7 %, the throwable falls from 50 % to 41.7 % and nothing from 26 % to 21.7 %.
  • At talent level 2 (+10) each material weighs 16, the total is 140, one material is 11.4 %, any material is 45.7 %.
  • From journey 3 on the throwable id changes (30001 becomes 30004, the "Throwing Knife" slot becomes "Huge Fang"); the weights do not.

Worked example: guaranteed bones and potions#

The usual three-group set on a story 1 enemy is 10004;10014;10020:

GroupContents (journey 1)
10004nothing 68, Predator's Skull 8, Predator's Spine 8, Ruptured Tail 8, Active Sendril 8 (1-2)
10014Bone Fragment 65 x3, Bone Fragment 35 x3-4 (always drops; 100 % of the time 3 or 4)
10020nothing 65, Health Potion 35 x1

So an enemy like this always gives 3-4 Bone Fragments, has a 32 % chance of one material and a 35 % chance of a Health Potion. If all Health Potions are full the potion chance is 0, not "re-rolled": the group then holds only the "nothing" row and yields nothing.

First-kill drops#

If a monster row has a FirstDropCompleteQuestId and that quest is not yet complete, the game uses FirstDropId instead of DropId and completes the quest. Nothing from the normal list is rolled that time. The quest flag can be shared. Five story 1 enemies (ids 1012, 1028, 1034, 1036, 1037) share quest 12208, so only the first of them you kill gives the bonus Raw Stone; the others fall back to their normal lists. Two enemies (1010, 1033) share quest 12203.

Only 16 enemies in the main stories carry a first-kill drop (Arcade copies are ignored here):

Quest flagEnemy idsFirst-kill list instead of the normal one
1220210013-4 Bone Fragments only (no material roll)
1220110353-4 Bone Fragments only
1220410092 Active Sendril, plus the usual bones and potion roll
122031010, 10332 Active Sendril, 8-10 Bone Fragments, 1 Health Potion, 1 Ruptured Tail, all guaranteed
122081012, 1028, 1034, 1036, 10371 Raw Stone, plus the usual bones and potion roll
1220510251 Ruptured Tail, plus the usual bones and potion roll
12206, 122071032, 10398-10 Bone Fragments, 1 Chipped Immundus, 1 Health Potion, all guaranteed
223012023Keeps its normal first group (10002), adds 1 guaranteed Blood-stained Scissors, and swaps the normal 10-12 Bone Fragment group for a 4-7 bone group (4, 5-6 or 7) before the normal potion roll
5320150541 Strange Gall Bladder instead of the normal material group
5320250842 Raw Stone instead of the normal group

First-kill status is stored with the quest flags in the save, so it is not reset by dying.

Sanity drops#

A second list, SanDropId, exists on 1188 enemies. It is rolled only when the hero you are playing is not in the normal sanity state when the enemy dies (the check accepts any non-normal state, see Sanity). The result never lands on the floor: it is added to the bag at once (with a fly-to-hero pick-up animation only if an auto-pick-up trophy is equipped).

The lists are almost identical in every story: nothing 60, Anthozoan Bones 40. Amount: 1-2 in stories 1, 2, 3 and 5, 2-3 in stories 4, 6, 7 and 9. The bones are the same currency used for Heggie offerings. A sanity kill therefore gives 40 % of one batch of Anthozoan Bones on top of the normal drop.

When a hostile copy of a hero ("nightmare" enemy, the sanity monster or a summoned hero) dies, group 99999 is rolled (same 60/40 for 2 Anthozoan Bones), and any Health Potions that copy used are returned to you as a drop.

Talent bonus: Lucky Madness#

Talent type 43 ("ItemProbAdd") exists once for the first five heroes, always named Lucky Madness:

HeroTalent rowItem types covered
Terrence28701 (trophy materials), 706 (other materials)
Viola64801 (stones), 803 (reinforcement stones)
Benita99802 (medicine stones), 702 (medicine materials)
Norwood131trophies 601-603
Jerold169trophies 601-603 (the in-game text promises combat items, so the data and the label disagree)

The talent value is 1 at level 1 and 2 at level 2. That value picks the column: level 1 adds ProbAdd1 (5 in 866 of 874 rows; only the eight Heggie-stash rows of group 99998 have 0) to the weight of each listed entry of a covered type, level 2 adds ProbAdd2 (10). The summed talent value is used as the column suffix, so a sum of 3 or more would look for a non-existent ProbAdd3 and add nothing (inferred; no hero has two such talents).

  • The bonus is added to the weight, not multiplied. On a weight-6 entry +5 is a 83 % relative gain; on a weight-8 entry it is 62 %. The menu text promises "50 %" and "+50 %" per level, so the label and the data disagree.
  • The talent text says the bonus applies "in the Abnormal state". The drop routine contains no sanity check, so the bonus is active on every roll (controllerstorymode.lua:5355-5380 and fs_herodata.lua:401-431: no sanity condition); not tested in game.
  • The same code is used for the maze table.

Viola's bullets#

Viola (hero 10002) has an extra rule on every kill: a chance of BulletColorAddRateBase x 100 permille, which is 100 permille. The random check getRandomResult draws 0-1000 and succeeds when the draw is at or below the value, so 100 gives 101 in 1001 (about 10.1 %). A success drops Ammo (item 20009). The amount is the base rate (1) plus the talent value of type 99 (ColorBulletAdd), and the same sum is multiplied by 100 to get the chance, so each point of that talent adds another 10 percentage points of chance as well as 1 ammo per drop.

Maze drops#

The maze uses its own table, StoryMazeDrop (2947 rows), keyed by maze level (1-30) and DropId, instead of the story journey. There are no per-journey columns, but the same weighted roll and the same ProbAdd columns apply. Groups:

GroupWhat it holds
10001-10002, 10005Spectre Mushroom (the maze currency), larger batches for 10005
10003Consumables (Elixirs, Brute Force, and so on) plus nothing
10004Utility items (Vertebra Nail, Hound Amulet, Glowstone) plus nothing
10006-10009Maze trophy-type items (10006: Bloodthirsty Eye, Beastheart Stone and similar; 10007: Skullcutter, Beast Chain and similar; 10008: Mist Bracer, Brass Mask and similar; 10009: Zealot's Crest, Raw Gem Amulet)
10010Only at levels 23-30: Zealot's Crest or Raw Gem Amulet (higher-grade ids), no "nothing" row, so it always yields one. Its list is 12 entries (total weight 60) at level 23 and only 2 entries (total weight 10) at level 30
10096 / 10097 / 10098The three crate tiers: Spectre Mushroom
10099nothing 90, Health Potion 10

Worked example: group 10001 at level 1 gives 1 Spectre Mushroom (75) or 2 (25), average 1.25. Group 10005 at level 1 gives 41-45 (50) or 46-50 (50).

Maze crates#

Each maze crate tier gives a Spectre Mushroom range that grows by 1 per maze level. Checked for all 30 levels, with L = maze level:

CrateGroupAmount
Common10096(19 + L) to (25 + L)
Elite10097(31 + L) to (37 + L)
Nightmare10098(43 + L) to (49 + L)

At level 1 that is 20-26, 32-38 and 44-50; at level 28 the nightmare crate gives 71-77.

When the crate is generated the tier index is chosen with a flat random number between 1 and the number of tiers (three). The Prob column in StoryMazeCrate (60 / 30 / 10) is never read by the code (the scene code draws a flat random index from 1 to the number of tier rows), so the three tiers are equally likely and the 60/30/10 in the data is unused. A locked crate spawns guard monsters when opened.

The chance that a crate appears on a floor at all is 500 permille (50.05 %), with a safety rule: after one floor without a crate the next floor always has one. See Maze rewards.

A summoned hostile hero killed in the maze drops 10 + 2 x maze level Spectre Mushrooms and restores 10 % of your sanity bar in the maze.

Maze tier scaling of hazards#

Traps and tricks take their journey tier from the maze level; the table is in Traps and tricks#Which journey is used.

Death drops and the Heggie stash#

Dying costs bone currency, and a trophy can bring it back as a drop. Details are in Death and respawn.

Other rules#

  • The ground-drop routines (normal and maze groups) return at once in the Boss Time Challenge mode; the sanity-drop routine has no such check (inferred).
  • When a pick-up goes through the auto-pick-up routine (sanity drops and ground items you walk over), Bone Fragments (item type 401) are doubled while a status of logic type ExpAdd is active, and Spectre Mushrooms (type 404) while a MazeExpAdd status is active.
  • An item that would take you over its stack cap is truncated at the cap (the rest is lost).
  • Every drop roll re-seeds the random generator from the current clock second (its last six digits, reversed) plus the enemy's id and the group index, so two groups of one enemy use neighbouring seeds. The position offset is a random +/-0.5 m on x and z, applied only when the corpse is less than 3 units above the ground it stands on.
  • Five story 5 enemies (ids 5101, 5102, 5103, 5105, 5128) list group 50009, which has no rows in the table. That entry yields nothing; their other groups (50093, 50096) still roll.

Hidden mechanics#

  • "Nothing" is a real weight, and full flasks remove the potion row from the total: with full flasks the potion groups simply never pay out.
  • The Lucky Madness label (+50 %) does not match the data (+5 or +10 weight points).
  • A first kill replaces rather than adds to the drop list, and the quest flag can be shared between several enemies.
  • A sanity drop is a second chance: it requires only a non-normal sanity state at the moment of the kill and goes straight to the bag, so it cannot be missed on the ground.
  • The maze table scales by maze level, the story table by New Game Plus journey.

Sources#

  • controller/controllerstorymode.lua lines 3340-3474 (death handling, first drop, DropId split), 5136-5345 (CreateDropItem, CreateMazeDropItem, CreateMazeCrateItem, CreateSanDropItem, SetStoryDropItem, CreateDropBullet, CreateNightmareDropItem, CreateHostPlayerDropItem), 5355-5479 (GetStoryDropItem, GetMazeDropItem), 4592-4620 (AutoGetItem).
  • structdata/ms_storyitemdrop.lua 1-57 (loop columns, FrogDropId = 99998); structdata/ms_storymazedrop.lua; structdata/fs_savestory.lua 1952-1968 (SetLoop, GetLogicLoop), common/mathhelper.lua 210-238 (getRandomResult, getRandom).
  • structdata/fs_herodata.lua 401-428 and structdata/ms_herotalent.lua 175-200 (talent value and condition).
  • gamedata/playerdefine/hero10002_define.lua line 95; animalbase_define.lua line 232 (SanMonsterDropId 99999).
  • Tables: ItemDropData (groups 10001, 10002, 10004, 10010-10020, 99998, 99999 of story 1), HeroTalent rows 28, 64, 99, 131, 169, StoryMonster (DropId, FirstDropId, FirstDropCompleteQuestId, SanDropId), StoryMazeDrop (levels 1-30, groups 10001-10010, 10096-10099), StoryMazeCrate rows 1-3. Scripts and extracts: build/wiki/scripts/world_mech/drops2.py to drops4.py, maze.py.