Port AVA2 drop tables and drop code
make_drops.py builds 203's mob_drop_item / common_drop_new / special_item_group from AVA2's (unknown items removed and renumbered, AVA2 boxes replace the same vnum except 50035). The game loads common_drop_new.txt (level-range common drops), GetDropPct follows AVA2 (premium/glove rates, fixed precedence bug), a mob's second drop group no longer uses an uninitialised pointer, special groups allow 1023 entries, and the wiki lists common_drop_new rows as rule 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
cd395c73b7
commit
38b62cfdbd
@@ -0,0 +1,38 @@
|
||||
# AVA2 drop tables
|
||||
|
||||
203 drops what AVA2 drops. Tables: `tools/ava2-drops/make_drops.py`. Code: `ITEM_MANAGER::ReadCommonDropNewItemFile` (item_manager_read_tables.cpp), the common-drop block and `GetDropPct` in item_manager.cpp, the load in input_db.cpp. The items AVA2 drops that 40250 lacks come from metin2-client `tools/server/ava2-items` and must be installed in the same deploy (the readers fail on an unknown item vnum and the core stops).
|
||||
|
||||
## Tables
|
||||
|
||||
Built by `make_drops.py <AVA2 locale dir> <203 locale dir> <out dir> <item_proto.txt>...`, the protos being every row the db will load (live item_proto.txt + ava2-items' items-server.tsv).
|
||||
|
||||
| File | Content |
|
||||
|---|---|
|
||||
| mob_drop_item.txt | AVA2's 247 `drop` groups. Entries with an unknown item are removed and the rest renumbered: the reader stops at the first missing index. |
|
||||
| common_drop_new.txt | AVA2's 26 level-range common groups (new file, see below). |
|
||||
| special_item_group.txt | 203's groups; AVA2's groups replace those of the same box vnum (50011, 50082, 50186, 50255) and AVA2-only boxes are added. 50035 keeps 203's group: it is the children's day box on 203 but a GM box on AVA2. |
|
||||
| common_drop_item.txt, etc_drop_item.txt | empty, as on AVA2. |
|
||||
|
||||
`report.json` lists group counts, removed items and replaced boxes.
|
||||
|
||||
## common_drop_new.txt
|
||||
|
||||
```
|
||||
Group <name>
|
||||
{
|
||||
map_index 0 # 0 = every map, otherwise the maps listed
|
||||
level_range <min> <max> # killer level
|
||||
<n> <item vnum> <count> <pct> # pct as a float, chance = pct / 100
|
||||
}
|
||||
```
|
||||
|
||||
A group drops when the monster level is within 20 of the killer, the killer level is in `level_range` and the map matches. Each entry is rolled against `GetDropPct`'s range (base 4,000,000) with probability `pct × 40000`. A missing file is logged and skipped; a parse error or unknown item fails the boot like the other drop files.
|
||||
|
||||
## Changes to the drop code (from AVA2)
|
||||
|
||||
- `GetDropPct`: premium item or glove doubles the drop rate, otherwise +50%; the permanent glove adds 100 (50 with premium) to the denominator bonus. `iRandRange = 4000000 * 100 / (100 + priv + bonus)`; 203 had an operator-precedence bug that fixed the divisor at 100.
|
||||
- PC-bang bonus removed. The event-manager bonus is not ported (203 has no ENABLE_EVENT_MANAGER).
|
||||
- A mob with two `drop` groups no longer reads an uninitialised group pointer.
|
||||
- special_item_group.txt groups may have up to 1023 entries (AVA2's cofreskindop boxes have 267).
|
||||
|
||||
The wiki (`/mt_features ... mob`) lists common_drop_new rows as rule 0 (FEATURE-QUERY-PROTOCOL.md). Not ported: AVA2's `/reload y`; quest-script and hardcoded drops are not compared.
|
||||
@@ -39,7 +39,7 @@ Rules:
|
||||
|
||||
| RULE | Meaning of MIN/MAX and weights |
|
||||
|---|---|
|
||||
| 0 | rank common drop; MIN/MAX = eligible player levels |
|
||||
| 0 | rank common drop (common_drop_item.txt) or level-range common drop (common_drop_new.txt, MIN/MAX clipped to monster level ±20); MIN/MAX = eligible player levels |
|
||||
| 1 | independent monster drop group; weight is original configured threshold, not final probability |
|
||||
| 2 | weighted kill group; MIN = original kill-per-drop parameter; weight/group total describe the conditional selection |
|
||||
| 3 | level group; MIN = player minimum level; original denominator 1,000,000 |
|
||||
|
||||
Reference in New Issue
Block a user