commit 64c01c7f7d81dad4b8723eee7b9758e3ccca9f3c
parent b0483924a1c4cee48e40ef8c29b6b5cbe8c0806e
Author: anon <anon@example.com>
Date: Thu, 29 Oct 2026 04:23:53 +0000
Enable Omni training boss combat and equipment drops
Diffstat:
7 files changed, 411 insertions(+), 11 deletions(-)
diff --git a/TODO.md b/TODO.md
@@ -949,6 +949,16 @@ are recorded in [reclaim](docs/reclaim.md).
distributions remain open. The mirrored Leets page names Monster Parts but dates
to 2010; neither it nor the dated newbie gathering accounts establish 14.9.1
drop chances or cash formulas. See [NPC loot](docs/npc-loot.md).
+ Omni Training's authored level-4 BNMO now has an explicit, low-confidence
+ Aquaan profile and QL 3..5 gloves/pistol pool through the same shared rules.
+ It retains mapping alternatives and provisional attack/balance/drop choices;
+ the selected original attack endpoints are independently audited. Four native
+ kills earned 600 XP, 10 corpse credits and QL 5 gloves / a QL 3 pistol. Pickup,
+ refusal without losing the unqualified gloves, pistol sale, a loot-funded
+ boots purchase, qualified wear and page/server restart preservation passed
+ with the retained ordinary earned character. Raising that character to wear
+ the retained gloves and the broader progression gate remain open.
+ See [Omni training boss](docs/omni-training-boss.md).
- [x] Connect selected-quality regular equipment to an authored training boss.
The original level-4 Clan Training BSML placement now admits a code-restricted
Salamander profile with original bite endpoints and explicit QL4 gloves/pistol
@@ -1305,6 +1315,17 @@ introduction and starting-item gameplay remain open below.
153 categories but do not establish their stock. Research online for shop
inventories, categories and QL ranges where the game data is insufficient,
and verify that the evidence applies to 14.9.1. Do not infer stock from names.
+- [ ] [P0] Recheck the native Startup Shop body and picking in Omni Training.
+ The level-3 earned-character run showed nearby tutorial markers but could not
+ locate the machine body at the authored 60/14/50 placement. An earlier
+ level-2 run rendered and used the machine there. The native VendingMachine
+ body for 51035:3221226422 is byte-identical in both captures (SHA256
+ 8dd4ea378e31eae900069076883e21c242fb6e1503fd793bb168d3540fe33c06).
+ Reproduce with fresh and returning clients; distinguish camera/level-dependent
+ visibility from scene initialization, static aliases and replay ordering
+ before changing server publication or the client. Verify ordinary starter
+ sales after any fix. Evidence: `local/omni-training-boss/` spawn comparison
+ and `local/early-melee/runtime/owner/pair-open-training-shop.png`.
- [ ] [P1] Restore the Secondhand Peddler and reusable NPC shop interactions in
the original training grounds. Funcom's
[14.7.10 notes](https://worthplaying.com/article/2003/2/26/news/8473-anarchy-online-update-patch-available-now/)
diff --git a/docs/combat-npc-balance.md b/docs/combat-npc-balance.md
@@ -5,6 +5,9 @@ not supply a complete set of historical creature health, ratings and armor.
The server admits Leet levels 1..5 through the bounded profiles below and
[mapped Tiny Stalkers at levels 2..4](tiny-stalker.md). Unprofiled creatures retain
prototype 100 HP, 5 damage and one-second attack/recharge phases.
+The [Omni training boss](omni-training-boss.md) now uses an explicit level-4
+profile and original Aquaan attack endpoints; its identity and balance remain
+provisional. The separate Clan boss retains its existing independent profile.
## Bounded early progression
diff --git a/docs/loot-quality-ranges.md b/docs/loot-quality-ranges.md
@@ -22,13 +22,18 @@ Production selections currently remain deliberately small:
| --- | --- | --- |
| Level 1 Leet | Monster Parts | 1 |
| Level 2 Leet | Monster Parts | 1..3 |
+| Level 3..5 Leet | Monster Parts | 2..4 through 4..6 |
+| Level 2..4 Tiny Stalker | Monster Parts | 1..3 through 3..5 |
| Authored level-4 Clan training boss | Metaplast gloves / Rusty pistol | 4 / 4 |
+| Authored level-4 Omni training boss | Metaplast gloves / Rusty pistol | 3..5 / 3..5 |
-The level-2 interval and uniform distribution are reconstruction policy. The
+The level-relative intervals and uniform distribution are reconstruction policy. The
existing membership chances, cash and reward baselines remain provisional.
This does not claim a universal original `loot QL = creature level` rule or
scale outdoor NPCs to a visiting player's level. Broader species, useful equipment
pools, mission generation and historical distributions remain open P0 work.
+The [Omni training boss](omni-training-boss.md) adds useful equipment intervals
+through these same selection and ownership rules, without new Go behavior.
## Regular Monster Parts
diff --git a/docs/npc-loot.md b/docs/npc-loot.md
@@ -1,9 +1,12 @@
# NPC corpse rewards
Normal deaths generate rewards from the admitted species/level combat profile.
-Species evidence in the stable definition is required; a matching placeholder
-body alone does not qualify. See [profile eligibility](npc-profile-eligibility.md).
-The current production profiles are level 1 and level 2 Leets. Each configured loot row rolls
+Generic profiles require species evidence in the stable definition; an explicit
+template-bound profile also admits its reviewed best-effort body. A matching
+placeholder alone does not qualify. See [profile eligibility](npc-profile-eligibility.md).
+The admitted profiles cover Leets at levels 1..5, mapped Tiny Stalkers at 2..4,
+the level-4 Clan training Salamander boss and the
+[level-4 Omni training boss](omni-training-boss.md). Each configured loot row rolls
independently, selects a quality from its explicit inclusive interval, and
places it in a free corpse slot. Cash is selected inclusively from the configured
range. Unprofiled creatures do not inherit a universal loot table.
@@ -18,9 +21,11 @@ choices from the recovered weapon values and population identities.
The first table uses original Monster Parts 42640, QL 1, with a **provisional 50%
chance and 1..5 credits**. Those probabilities and cash amounts are reconstruction
values, not recovered 14.9.1 formulas. The independent-row/uniform-cash policy is
-also provisional. No equipment drop, variable quantity or universal loot-quality
-formula is inferred from a creature's name or level. Useful equipment loot,
-broader species/levels and original reward distributions remain open in TODO.
+also provisional. Equipment membership is declared only for the two admitted
+training bosses, not inferred from another creature's name or level. The Omni
+profile selects supported QL3..5 gloves/pistols; the Clan profile retains fixed
+QL4. Broader useful pools, variable quantities, historical distributions and a
+universal loot-quality rule remain open in TODO.
## Evidence boundary
@@ -80,10 +85,9 @@ Startup rejects missing/zero or reversed bounds, unknown templates and intervals
outside the template's reviewed family. Fixed-QL items accept only their authored
quality as both bounds. Quality is sampled after successful membership; fixed
and empty drops do not consume a quality roll. The shared
-`server/gamedata/item_families.yaml` lists fourteen reviewed endpoint pairs:
-six Metaplast pieces, Backpack of Survival, NCU Hacker Interface, the QL1..11
-Rusty OT M-10 Flechette Pistol, regular QL1..400 Monster Parts and QL1..200
-Low-Tech gloves, and three regular QL1..200 recovery-supply families described in
+`server/gamedata/item_families.yaml` lists the reviewed endpoint pairs, including
+Metaplast, Low-Tech, the QL1..11 Rusty OT M-10 Flechette Pistol, regular QL1..400
+Monster Parts and the recovery supplies described in
[medical qualities](medical-quality.md).
Either endpoint identifies a family. No name or neighboring-ID heuristic pairs
additional definitions, and listing a pair does not implement its effects.
diff --git a/docs/omni-training-boss.md b/docs/omni-training-boss.md
@@ -0,0 +1,151 @@
+# Omni Training boss
+
+The original population places BNMO at level 4 at
+`[189.13745, 15.594147, 177.76439]`, definition
+`950/district/6/fixed/0`, in Omni Training's Dyna boss district. The complete
+mapping catalog selects Aquaan/MonsterData 30369 with low confidence. Its
+alternatives include a nonvisual encounter controller and another historical
+camp species. The selected body is not a recovered server template.
+
+The mapping evidence includes Nadybot's pinned
+[`dynadb.csv`](https://github.com/Nadybot/Nadybot/blob/de9e3b2c8d2f91df87c614a3d9f91bc16c2eacf2/src/Modules/HELPBOT_MODULE/dynadb.csv)
+Aquaan camp at 189,179, 1.24 m from the original point, with matching level 4.
+That later camp list corroborates the reconstruction; it does not establish
+original stats, attacks, loot or boss modifiers. The other authored BNMO
+Aquaan context is level 15..17 in Omni Forest and receives no level 4 profile.
+Other BNMO contexts use a different body. The maintained population audit
+checks that exactly this one original placement is admitted.
+
+## Combat and loot
+
+Original item records 120715..120720 contain AquaanOnearmslash and
+AquaanTwoarmslash endpoint pairs and their AQW1/AQW2 equipper codes. Both pairs
+span QL 1..400, use Martial Arts against Evade Close, melee damage, five-meter
+range and 235-centisecond attack/recharge. Selecting Onearmslash alone is
+provisional. At actor QL 4 its original damage is 7..16 with critical bonus 8.
+All six complete source payloads match the maintained catalog, including
+section layouts and hashes; no tail is undecoded. The original index SHA-256 is
+`46e5dc54af9358cc9bff05f4358e86af630e497bc677f361c133c88073b84d71`.
+
+The explicit profile uses the existing level 4 early balance: 150 HP, 150 solo
+XP, raw MA/evades/Nano Resist 15, initiative 0/AggDef 75, cash 1..5,
+100-second respawn and 180-second corpse lifetime. These are provisional
+gameplay choices, not recovered historical boss scaling. Combat, pursuit,
+health recovery, death, XP and persistence use the existing shared rules.
+
+The provisional equipment pool reuses the reviewed starter-boss families:
+
+| Item | QL interval | Independent chance |
+| --- | --- | --- |
+| Metaplast gloves 85596/85595 | 3..5 | 50% |
+| Rusty OT M-10 Flechette Pistol 123742/123743 | 3..5 | 25% |
+
+Membership and uniform inclusive quality selection are separate draws. Empty
+rolls remain possible. These nearby QLs are a bounded reconstruction policy,
+not a universal original NPC-level loot formula or a measured drop table.
+Shared interpolation, requirements, native endpoint delivery, corpse pickup,
+equipment and sale consumers retain the same physical instance. Original item
+requirements and prices are unchanged; finding an upgrade does not guarantee
+the current player can wear it immediately. A pistol still needs ammunition.
+
+Modern Aquaan guides mention Miy's Armor; the selected 14.9.1 item-name catalog
+contains no Miy's armor definitions. That later loot is not imported.
+The mirrored Aquaans page was last touched in 2010
+and supplies no original boss inventory or combat measurement. The available
+14.5 patch-note mirror describes dynacamps and special boss loot generally;
+it does not enumerate this boss's drops. Neither is treated as evidence for
+the selected regular-equipment membership or probabilities.
+
+## Verification
+
+New tests exercise the actual authored binding and its cold reconstruction,
+native attack endpoints, rejected code/body/level/evidence and the separate
+outdoor guardian. All six direct killing paths generate low, middle and high
+selected equipment QLs. Membership boundaries include both, armor-only and
+empty outcomes. A failed second item, ignored placement or failed COMMIT keeps
+the target alive, reserves no identities and awards no XP; the same killing
+action retries with both selected items committed together.
+
+The first preview load reused an unprofiled development snapshot whose saved
+motion home was zero. Admission gave it combat movement, which returned toward
+the map origin. Before gameplay verification, disposable public NPC snapshots
+were recreated from the current authored population; all player, item and
+mission rows were preserved. This is a development-data refresh, not a legacy
+state reader or migration. The fresh profile's home and cold reconstruction
+are covered by the authored-spawn test.
+
+The complete maintained Go suite passes 1,696 roots / 16,641 results, with no
+failing or skipped tests. The assets and export packages compile without test
+files. The final focused selection passes 5 roots / 38 results, including an
+additional fresh/cold home-position assertion. The related race selection
+passes 13 roots / 70 results. Production data stayed fixed throughout these
+runs and the native checks.
+
+Original payloads, mapping alternatives, source notes, test logs and native
+evidence are retained under `local/omni-training-boss/`. This profile supplies
+an ordinary Omni loot source; it does not complete historical loot recovery,
+all starter balance or the full progression acceptance gate.
+
+## Ordinary native progression
+
+The retained level-3 Atrox Enforcer walked from its previous earned position
+to the boss and defeated four full-health lives using its existing QL3 bat.
+No player stats, HP, funds, items, positions or drop rolls were provisioned.
+The public-population refresh described above precedes these fights. Native
+initialization agrees with the original attack's QL4 endpoints, damage, critical
+bonus and timing. The final two fights also used native Fast Attack, dealing
+9 and 5 damage through the ordinary equipped action.
+
+| Life | Starting player HP | Incoming damage | Observed recovery | Settled player HP |
+| --- | ---: | ---: | ---: | ---: |
+| First | 138 | 54 | 0 | 84 |
+| Second | 116 | 91 | 4 | 29 |
+| Third | 138 | 57 | 0 | 81 |
+| Fourth | 138 | 72 | 4 | 70 |
+
+Each settled native result agrees with the live server. Outgoing damage was
+153, 153, 150 and 153, including the enemies' observed combat recovery. Four
+deaths awarded 600 XP and corpse collection added 10 credits. The first three
+rolled no equipment. The fourth generated Metaplast gloves 145 at QL 5 and Rusty
+pistol 146 at QL 3. Native left-click pickup moved these exact instances into
+ordinary inventory slots 81/82. Initial right-click attempts transferred nothing;
+their retained screenshots and packets are not counted as successful pickups.
+
+The original requirements refuse the QL 5 gloves at Strength 15/Agility 11: they
+need 17/18. The refused item remains visible and owned, and worn Low-Tech gloves 38
+remain in hands slot 24. This verifies refusal and conservation, not qualified wear
+of that drop. Raising the character and wearing the retained gloves remains
+part of further progression.
+
+During resupply, ordinary travel reached the basic medical shop. Selling spare
+earned QL 2 bat 72 for 171 credits and buying laboratory 144 for 150 left 63 credits.
+All other item records and locations were unchanged. The laboratory arrived
+with 50 charges. In the training grounds, one charge restored 97->127 HP; after
+ordinary recovery, another restored 131->138. The same laboratory retained 48
+charges. The equipped QL 3 bat 87 was never sold or removed for this purchase.
+
+At the basic armor shop, a basket offered the generated pistol for 142 credits
+and selected QL 1 Low-Tech boots for 142. Declining preserved the pistol in its
+original slot, the 71-credit wallet and all 23 owned items, without creating a
+purchase. Repeating the basket and accepting removed exactly pistol 146 and
+created boots 147. The same boots then moved to feet slot 30 through native
+right-click wear. The existing Strength 15/Agility 11 qualifies without new
+training; their original modifiers add 3 projectile/melee AC and 1 to each of
+the other six ACs. Native totals changed from 6/16/2/2/2/2/2/2 to
+9/19/3/3/3/3/3/3. The equipped bat, shirt, gloves and sleeve were retained.
+
+The live armor action creates a template-only native row; the committed database
+retains instance 147. Both a page reload and a full restart of the same server
+binary restore native instance 147 in feet slot 30, with the same AC totals.
+Gloves 145 remain in inventory, laboratory 144 retains 48 charges, XP is 1,675
+toward the next level (5,725 cumulative), and the wallet is 71. All baseline item
+records and locations except intentionally sold bat 72 remain unchanged. The
+character owns 23 items. SQLite integrity and foreign-key checks pass, and the
+isolated GPU WASM runs captured no page errors.
+
+The native training Startup Shop body could not be found during this level-3
+run, although an earlier level-2 run rendered and used it. Its vending packet
+body is byte-identical in the two captures. The successful resupply and armor
+purchase above used ordinary travel to the basic city shop. A P0 TODO retains
+the startup-shop reproduction and camera/level/scene/picking alternatives;
+these checks do not establish a missing packet or its cause.
diff --git a/server/gamedata/npc_combat.yaml b/server/gamedata/npc_combat.yaml
@@ -96,6 +96,31 @@
quality: [3, 5]
chance: 50
+30369:
+ 4:
+ # Only the authored Omni Training BNMO uses this level/body/code combination.
+ # The Aquaan identity is low-confidence; see docs/omni-training-boss.md.
+ template_code: BNMO
+ # Provisional level-4 early balance, not a recovered boss template.
+ health: 150
+ experience: 150
+ skills: {100: 15, 153: 15, 154: 15, 155: 15, 168: 15}
+ # Original AquaanOnearmslash endpoints; selecting this attack is provisional.
+ weapon: [120715, 120716]
+ initiative: 0
+ agg_def: 75
+ respawn_seconds: 100
+ corpse_seconds: 180
+ credits: [1, 5]
+ # Provisional regular-equipment pool and nearby QLs, not historical drop data.
+ loot:
+ - template: 85596
+ quality: [3, 5]
+ chance: 50
+ - template: 123742
+ quality: [3, 5]
+ chance: 25
+
30354:
4:
# The original Clan Training fixed boss; ordinary salamanders do not inherit it.
diff --git a/server/omni_training_boss_test.go b/server/omni_training_boss_test.go
@@ -0,0 +1,191 @@
+package main
+
+import (
+ "ao/server/gamedata"
+ "encoding/binary"
+ "fmt"
+ "slices"
+ "testing"
+ "time"
+)
+
+func TestOmniTrainingBossIsTheOnlyAdmittedAquaanPopulation(t *testing.T) {
+ spawns, err := readNPCSpawns()
+ if err != nil {
+ t.Fatal(err)
+ }
+ var admitted []string
+ for _, npc := range spawns {
+ if npc.monsterData == 30369 && npc.combatProfile != nil {
+ admitted = append(admitted, npc.npcDefinitionID)
+ }
+ }
+ if !slices.Equal(admitted, []string{"950/district/6/fixed/0"}) {
+ t.Fatal("Omni profile spread to another authored population", admitted)
+ }
+ data := testNPCData()
+ data.Playfields[0].Districts[0].Groups[0] = *gamedata.NPCGroups["950/district/6/fixed/0"]
+ useNPCData(t, data)
+ world := newTestServer(t)
+ if err := world.flushWorld(); err != nil {
+ t.Fatal(err)
+ }
+
+ cold := newTestInventoryServer(t)
+
+ for _, current := range []*server{world, cold} {
+ npc := current.characters[1000000]
+ if npc.name != "Aquaan Boss" || npc.level != 4 || npc.monsterData != 30369 || npc.health != 150 ||
+ npc.combatProfile == nil || npc.attackRating() != 15 || itemStat(npc.attackWeapon(), 286) != 7 || itemStat(npc.attackWeapon(), 285) != 16 ||
+ npc.motion == nil || npc.motion.home != npc.position || npc.motion.returning {
+ t.Fatal("authored Omni boss lost its explicit combat contract", npc)
+ }
+ packet := targetPacket(characterPacket(npc))
+ end := int(binary.BigEndian.Uint16(packet[6:8]))
+ if binary.BigEndian.Uint32(packet[end-16:end-12]) != 120715 || binary.BigEndian.Uint32(packet[end-12:end-8]) != 120716 ||
+ binary.BigEndian.Uint32(packet[end-4:end]) != 4 {
+ t.Fatal("native boss initialization lost its selected weapon endpoints or quality")
+ }
+ }
+}
+
+func TestOmniTrainingBossProfileRejectsOtherBindings(t *testing.T) {
+ for _, scenario := range []string{"other code", "placeholder", "other body", "level 3", "level 5", "outdoor guardian"} {
+ t.Run(scenario, func(t *testing.T) {
+ data := testNPCData()
+ group := &data.Playfields[0].Districts[0].Groups[0]
+ group.TemplateCode, group.MonsterData, group.Levels, group.AppearanceStatus = "BNMO", 30369, [2]uint16{4, 4}, "best_effort"
+ switch scenario {
+ case "other code":
+ group.TemplateCode = "AQ01"
+ case "placeholder":
+ group.AppearanceStatus = "placeholder_creature"
+ case "other body":
+ group.MonsterData = 30371
+ case "level 3":
+ group.Levels = [2]uint16{3, 3}
+ case "level 5":
+ group.Levels = [2]uint16{5, 5}
+ case "outdoor guardian":
+ *group = *gamedata.NPCGroups["716/district/60/fixed/0"]
+ }
+ useNPCData(t, data)
+ world := newTestServer(t)
+ if err := world.flushWorld(); err != nil {
+ t.Fatal(err)
+ }
+
+ cold := newTestInventoryServer(t)
+
+ if world.characters[1000000].combatProfile != nil || cold.characters[1000000].combatProfile != nil {
+ t.Fatal("an unreviewed Aquaan binding inherited training-boss combat or loot")
+ }
+ })
+ }
+}
+
+func newOmniTrainingBossKillWorld(t *testing.T, attack string) *server {
+ t.Helper()
+ world, _ := newKillExperienceWorld(t, attack)
+ target := world.characters[1000000]
+ target.monsterData, target.level, target.npcDefinitionID = 30369, 4, "950/district/6/fixed/0"
+ target.combatProfile = gamedata.NPCCombatProfiles[30369][4]
+ if err := world.flushWorld(); err != nil {
+ t.Fatal(err)
+ }
+ return world
+}
+
+func TestOmniTrainingBossDeathsSelectSupportedEquipmentQualities(t *testing.T) {
+ for _, attack := range []string{"unarmed", "axe", "pistol", "fling", "fast", "nano"} {
+ for quality := uint32(3); quality <= 5; quality++ {
+ t.Run(fmt.Sprintf("%s/QL%d", attack, quality), func(t *testing.T) {
+ world := newOmniTrainingBossKillWorld(t, attack)
+ world.combatRoll = func(limit uint32) uint32 {
+ if limit == 3 {
+ return quality - 3
+ }
+ return 0
+ }
+ before := world.nextItem
+
+ attackForExperience(t, world, attack)
+ world.advanceCombat(time.Now().Add(time.Hour))
+ world.advanceNanos(time.Now().Add(time.Hour))
+ cold := newTestInventoryServer(t)
+
+ want := []ownedItem{
+ {ID: before + 1, Type: 51022, Template: 85596, Quality: quality, Count: 1},
+ {ID: before + 2, Type: 51018, Template: 123742, Quality: quality, Count: 1, Slot: 1},
+ }
+ for _, current := range []*server{world, cold} {
+ corpse := current.characters[1000000].corpse
+ if corpse == nil || !slices.Equal(corpse.items, want) || corpse.credits != 1 || current.characters[1].experience != 150 || current.nextItem != before+2 {
+ t.Fatal("Omni boss death changed selected qualities, omitted rewards or repeated allocation", corpse)
+ }
+ }
+ })
+ }
+ }
+}
+
+func TestOmniTrainingBossCanRollIndependentOrEmptyLoot(t *testing.T) {
+ for _, scenario := range []struct {
+ roll uint32
+ count int
+ }{{0, 2}, {24, 2}, {25, 1}, {49, 1}, {50, 0}, {99, 0}} {
+ t.Run(fmt.Sprint(scenario.roll), func(t *testing.T) {
+ world := newOmniTrainingBossKillWorld(t, "unarmed")
+ world.combatRoll = func(limit uint32) uint32 { return min(scenario.roll, limit-1) }
+ before := world.nextItem
+
+ attackForExperience(t, world, "unarmed")
+ cold := newTestInventoryServer(t)
+
+ for _, current := range []*server{world, cold} {
+ corpse := current.characters[1000000].corpse
+ if corpse == nil || len(corpse.items) != scenario.count || current.nextItem != before+uint32(scenario.count) || current.characters[1].experience != 150 {
+ t.Fatal("membership boundary lost an empty result or changed the reward allocation", corpse)
+ }
+ }
+ })
+ }
+}
+
+func TestOmniTrainingBossFailedSecondDropRetriesAtomically(t *testing.T) {
+ for _, failure := range []struct{ name, sql string }{
+ {"insert", "CREATE TRIGGER fail_omni_boss BEFORE INSERT ON items WHEN NEW.template=123742 BEGIN SELECT RAISE(FAIL,'second drop'); END"},
+ {"ignored placement", "CREATE TRIGGER fail_omni_boss BEFORE INSERT ON item_locations WHEN NEW.slot=1 BEGIN SELECT RAISE(IGNORE); END"},
+ {"commit", "CREATE TABLE omni_boss_commit (id INTEGER REFERENCES items(id) DEFERRABLE INITIALLY DEFERRED); CREATE TRIGGER fail_omni_boss AFTER INSERT ON items WHEN NEW.template=123742 BEGIN INSERT INTO omni_boss_commit VALUES(999999); END"},
+ } {
+ t.Run(failure.name, func(t *testing.T) {
+ world := newOmniTrainingBossKillWorld(t, "unarmed")
+ world.combatRoll = func(uint32) uint32 { return 0 }
+ before := world.nextItem
+ if _, err := world.db.Exec(failure.sql); err != nil {
+ t.Fatal(err)
+ }
+
+ attackForExperience(t, world, "unarmed")
+ cold := newTestInventoryServer(t)
+
+ for _, current := range []*server{world, cold} {
+ if current.characters[1000000].health != 1 || current.characters[1000000].corpse != nil || current.nextItem != before || current.characters[1].experience != 0 {
+ t.Fatal("failed second reward committed a partial death or reward")
+ }
+ }
+
+ // Retry through the same production killing action.
+ if _, err := world.db.Exec("DROP TRIGGER fail_omni_boss"); err != nil {
+ t.Fatal(err)
+ }
+ attackForExperience(t, world, "unarmed")
+ retried := newTestInventoryServer(t)
+ corpse := retried.characters[1000000].corpse
+ if corpse == nil || len(corpse.items) != 2 || corpse.items[0].ID != before+1 || corpse.items[1].ID != before+2 ||
+ corpse.items[0].Quality != 3 || corpse.items[1].Quality != 3 || retried.characters[1].experience != 150 {
+ t.Fatal("retry lost selected qualities or repeated instance allocation", corpse)
+ }
+ })
+ }
+}