[P2][T07] 加载 RarePrefix.txt / RareSuffix.txt(46 + 155 行) #95

Closed
opened 2026-09-18 10:50:47 +00:00 by troytt · 1 comment
Owner

问题

稀有物品的名字由这两张表提供(Beast + bite → 「Beast Bite」)。缺了它们,稀有物品只能显示基底名。

金标准数据

两表同构,各 16 列,无任何分隔行:

name | version | itype1..itype7 | etype1..etype4 | add | multiply | divide
表 行数 归档来源
RarePrefix.txt 46 d2exp.mpq(Patch_D2 里没有)
RareSuffix.txt 155 d2exp.mpq

真实样例:

RarePrefix: Beast / Eagle / Raven / Viper / GhoulRI / Skull / Blood / …
              itype1=armo itype2=weap itype3=misc
            Spirit      itype1=armo itype2=rod
            Empyrion / Rule    itype1=rod
            Holocaust   itype1=tors helm shld swor axe
            Warp / Rift        ← itype 全空(任意物品)
            Entropy / Chaos / Corruption   itype1=ring itype2=amul
            Order       itype1=ring amul scep
            add / multiply / divide 全 46 行都是 0

RareSuffix: bite     itype1=swor knif spea pole axe h2h
            scratch  itype1=swor knif spea pole h2h
            scalpel  itype1=swor itype2=knif

实现要求

  1. 加载两张表。注意 Patch_D2.mpq 里没有这两张表,要从 d2exp.mpq 取。挂载优先级 Patch_D2 > d2exp > d2data,所以正常挂载后 read() 会自动落到 d2exp,但要确认挂载顺序正确。
  2. 映射成名字池,带 itype/etype 过滤条件。
  3. itype 全空表示「任意物品」(如 Warp / Rift)—— 不要把空当成「不匹配任何东西」。

陷阱

[!IMPORTANT]
这两张表只提供名字,不带任何属性 mod。 稀有物品的实际词缀来自 MagicPrefix/MagicSuffix 中 rare=1 的条目(T-06/T-15)。不要误以为 RarePrefix 会给属性。

[!WARNING]
itype 全空 = 通配。空数组的语义必须是「全部允许」而不是「全部拒绝」,写反了 Warp/Rift 就永远选不到。

[!NOTE]
.d2s 给稀有名字各留 8 bit(见 T-17),所以 index 必须落在 [0,255] 内。46 和 155 都安全。

验收标准

  • RarePrefix 46 行 / RareSuffix 155 行全部解析
  • 确认数据确实来自 d2exp.mpq(不是 d2data 的旧版)
  • itype 全空的条目被标记为通配
  • 所有非空 itype/etype 都能在 ItemTypes 里解析到
  • npm run typecheck 0 error
  • npx vitest run 全绿
  • npx tsx scripts/verify-items.ts 新增断言通过

溯源

金标准(数据) 1.13c MPQ data\global\excel\ 下的 RarePrefix.txt / RareSuffix.txt(本机 /usr/local/google/home/taodao/d2-data,挂载序 d2data → d2exp → Patch_D2,Patch_D2 优先)
本 issue 结论强度 本机 1.13c 实测确证(含「来自 d2exp 而非 Patch_D2」这一事实)

[!WARNING]
D2MOO 是 1.10f,不是本项目的金标准。 它只能作线索使用。任何涉及常量、列序、整数截断位置或 RNG 消耗次数的结论,都必须回到 1.13c 的表格或 DLL 复核后再落地。

## 问题 稀有物品的名字由这两张表提供(`Beast` + `bite` → 「Beast Bite」)。缺了它们,稀有物品只能显示基底名。 ## 金标准数据 两表**同构**,各 **16 列**,**无任何分隔行**: ``` name | version | itype1..itype7 | etype1..etype4 | add | multiply | divide ``` | 表 | 行数 | 归档来源 | |---|---:|---| | RarePrefix.txt | **46** | **d2exp.mpq**(Patch_D2 里没有) | | RareSuffix.txt | **155** | **d2exp.mpq** | 真实样例: ``` RarePrefix: Beast / Eagle / Raven / Viper / GhoulRI / Skull / Blood / … itype1=armo itype2=weap itype3=misc Spirit itype1=armo itype2=rod Empyrion / Rule itype1=rod Holocaust itype1=tors helm shld swor axe Warp / Rift ← itype 全空(任意物品) Entropy / Chaos / Corruption itype1=ring itype2=amul Order itype1=ring amul scep add / multiply / divide 全 46 行都是 0 RareSuffix: bite itype1=swor knif spea pole axe h2h scratch itype1=swor knif spea pole h2h scalpel itype1=swor itype2=knif ``` ## 实现要求 1. 加载两张表。注意 **`Patch_D2.mpq` 里没有这两张表,要从 `d2exp.mpq` 取**。挂载优先级 Patch_D2 > d2exp > d2data,所以正常挂载后 `read()` 会自动落到 d2exp,但要确认挂载顺序正确。 2. 映射成名字池,带 `itype`/`etype` 过滤条件。 3. `itype` 全空表示「任意物品」(如 `Warp` / `Rift`)—— 不要把空当成「不匹配任何东西」。 ## 陷阱 > [!IMPORTANT] > **这两张表只提供名字,不带任何属性 mod。** 稀有物品的实际词缀来自 `MagicPrefix`/`MagicSuffix` 中 `rare=1` 的条目(T-06/T-15)。不要误以为 RarePrefix 会给属性。 > [!WARNING] > `itype` 全空 = 通配。空数组的语义必须是「全部允许」而不是「全部拒绝」,写反了 `Warp`/`Rift` 就永远选不到。 > [!NOTE] > `.d2s` 给稀有名字各留 **8 bit**(见 T-17),所以 index 必须落在 `[0,255]` 内。46 和 155 都安全。 ## 验收标准 - [ ] RarePrefix 46 行 / RareSuffix 155 行全部解析 - [ ] 确认数据确实来自 `d2exp.mpq`(不是 d2data 的旧版) - [ ] `itype` 全空的条目被标记为通配 - [ ] 所有非空 `itype`/`etype` 都能在 ItemTypes 里解析到 - [ ] `npm run typecheck` 0 error - [ ] `npx vitest run` 全绿 - [ ] `npx tsx scripts/verify-items.ts` 新增断言通过 --- ### 溯源 | | | |---|---| | 金标准(数据) | 1.13c MPQ `data\global\excel\` 下的 `RarePrefix.txt` / `RareSuffix.txt`(本机 `/usr/local/google/home/taodao/d2-data`,挂载序 d2data → d2exp → Patch_D2,**Patch_D2 优先**) | | 本 issue 结论强度 | **本机 1.13c 实测确证**(含「来自 d2exp 而非 Patch_D2」这一事实) | > [!WARNING] > **D2MOO 是 1.10f,不是本项目的金标准。** 它只能作线索使用。任何涉及常量、列序、整数截断位置或 RNG 消耗次数的结论,都必须回到 1.13c 的表格或 DLL 复核后再落地。
troytt added this to the [M10] 真实物品系统:500 基础物品、1000 词缀、TreasureClassEx 掉落树 milestone 2026-09-18 10:50:47 +00:00
Author
Owner

已完成并通过 1.13c d2exp 真实表验证(46 前缀 / 155 后缀,通配与 itype 过滤),合并入 main (commit 20a8ff5)。

已完成并通过 1.13c d2exp 真实表验证(46 前缀 / 155 后缀,通配与 itype 过滤),合并入 main (commit 20a8ff5)。
Sign in to join this conversation.
No Label
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: troytt/diablo2-web#95
No description provided.