Commit Graph

260 Commits

Author SHA1 Message Date
Sam Sung 7361ddac1f The workspace tests pass on Windows: zone, census path and origin name (#2933)
Twelve workspace tests failed on Windows, from three causes:

- The census cut a site's path at `src/`, so a Windows path kept its whole prefix. It now cuts at either separator and prints `/`.
- The raise-origin panic named its caller from the backtrace, which a build without debug info resolves wrongly. It names the raise by its line, and lists callers only from frames that carry one.
- Ten zone tests set `TZ` through `std::env`, which never reaches the Windows C runtime's own copy of the environment. In 1.12.1, Lua's `date` and the screenshot names read the zone through the CRT's `_tzset`, which honours `TZ` (`0x4145d6`). The logon bias reads `GetTimeZoneInformation` alone (`0x4297c0`). The test helper now writes `TZ` where the CRT reads it, and the logon bias calls `GetTimeZoneInformation` directly, as the reference does.

Cross-checked for `x86_64-pc-windows-gnu`.

Fixes #2927
Fixes #2928
Fixes #2929

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 05:47:43 +07:00
Sam Sung 36e41ecf42 Item-text queries carry a u64 key; stats ask per table; console repeat (#2926)
Three gaps:

- CMSG_ITEM_TEXT_QUERY sent the text id, the mail id and a u32 0. `0x569980` writes the text id and a u64 key (`0x569a99`): the mail id under high dword 0x70000000, an item's guid, or 0 for the invoice. benilla now sends that key. vmangos reads only the first dword after the text id, which is unchanged.
- A group list and a deactivate asked for stats once per member. `0x4e85d0` and `0x4badc0` each send their own request, party first, so a subgroup mate is asked twice. benilla now runs both legs.
- `/console repeat N <command>` (`0x639250`) was missing. It now runs the command once a frame through the console executor and counts down (`0x63bd50`).

Tests: goldens for the three keys, the request count and order, the repeat count.

Fixes #2601
Fixes #2604
Fixes #2587

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 04:18:27 +07:00
Sam Sung 91d92a2714 A short AUTH_OK tail logs in; object reset-state and self-control fixed (#2917)
Three wire and unit-state gaps:

- An AUTH_OK or queue reply with a 5 to 8 byte billing tail failed the world connect. `0x5b41b0` reads each field through `GetUInt32` (`0x418eb0`), which writes nothing on a short read, and admits the player anyway. A short field now keeps its old value. Test: every tail length from 0 to 9.
- `SMSG_GAMEOBJECT_RESET_STATE` (`0x6e9790`) was unhandled. An object now re-applies its descriptor state, undoing the open-lock and loot predictions. Test: a byte-exact golden test of the body and a handler test.
- `IsSelfControlled` (`0x5fa550`) now reads flags 0x2 and 0x1, the charmer, and possession, which answers with the charmer's or creator's own reading. A moving charmed player's emote is no longer refused.

Fixes #2681
Fixes #2582
Fixes #2682

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 00:30:01 +07:00
Sam Sung 134f037600 Looking-for-group replies fill the list; group, guild and target fixes (#2892)
Five group, guild and spell-target defects in the Lua API.

- The looking-for-group reply (`0x4e8dc0`) filled nothing and `UPDATE_LFG_LIST` never fired. The list now fills with the reference's caps (50 records, name 0x30, comment 0x80) and signals once its quest titles are known. Deviation: a login starts with an empty list, where 1.12.1's getters read leftover memory.
- `SMSG_GROUP_CANCEL` reads the name it drops and fires `PARTY_INVITE_CANCEL` (`0x5e6770`, `0x48f440`).
- `GuildSetMOTD("")` sends no string (`0x48b2c1`-`0x48b2da`).
- `SpellCanTargetUnit` passes a unit on any arm (`0x6e6460`). A unit or corpse click that leaves bits in the word holds the spell, and the send carries the mask its binds gathered (`0xceac5c`, `0x7e4e10`).

Each new wire body has a byte-exact golden, and each fix has a unit test.

Fixes #2583
Fixes #2569
Fixes #2609
Fixes #2133
Closes #2666 (fixed by #2691)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 16:50:14 +07:00
Sam Sung e93c2e2129 Remote units dead-reckon from their create and each move's fire time (#2870)
In 1.12.1 every unit has mover state from its create (`0x619456` → `0x617b00`). A unit created moving is dead-reckoned from the create, and a move the tick fires mid-frame steps on from its fire time (`0x618d67`). benilla left such a unit standing until its first movement packet, and stepped a queued move over the whole frame.

Now every remote unit gets mover state at its create and is dead-reckoned from it and from each fire time. The facing system keys on the mover's bits and the unit's type (`0x600cd0`). A relay during a server path applies at once, and every monster move holds the spline that forces the next relay (`0x618c43`). The flush acts only on root and teleport (`0x618080`). A unit created airborne goes on along its arc, its start height rebuilt from the fall time.

Tests: one per behaviour, each failing on its parent.

Fixes #2853
Fixes #2852

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 07:31:22 +07:00
Sam Sung d5e37dd975 Every deviation names its reason, and a gate keeps it so (#2868)
`docs/METHOD.md` asks each deviation to name the reference fact and why benilla differs. About 130 `Deviation:` comments gave no reason, and the Warden comment lost its reason when the refusal became a read-past.

- `scripts/genmap.sh --check`, now a gate, fails a `Deviation:` comment without "because" and a `Deviates` row without a Why.
- `scripts/deviation-why.allow` lists the 43 comments whose change recorded no reason. It only shrinks: an entry that gains its reason, or is new against main's copy, fails.
- About 190 comments that gave their reason in other words now say "because", with their meaning kept.
- Nine reasons, the Warden one among them, come back from the commits and pull requests that made them.

Tested by the gate on the full tree, and by its failure on a comment with no reason and on a stale entry.

Fixes #2856
Fixes #2857

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 06:23:34 +07:00
Sam Sung c2f65546f9 A move's packet seats its unit when the movement clock has it due (#2851)
A remote unit's move was seated by the frame's movement pass, so a listener between two packets read where the unit stood before. 1.12.1 seats a move inside its packet when the movement clock has it due (`0x618dd2`), and holds it for the tick when not.

**Changed**
- A due move seats in its handler, stepped on by its lateness (`0x618bb0`). A rider seats on any game object flagged as a transport (`0x630a80`).
- A create seeds the unit's relay chain with its stamp (`0x619320`). On vmangos, a player who stood still before coming into view now trails by up to a second, as in 1.12.1.
- A plain relay ends its packet; only the speed relays read on (`0x6010e0`).
- `GetBattlefieldPosition` and `SpellCanTargetUnit` read positions at the call.

**Tests:** due and held moves, the catch-up, riders, the create seed, each read between packets. Each fails on main.

Part of #2217.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 01:16:08 +07:00
Sam Sung 194b7ee766 A path ends with the unit turned to the packet's final facing (#2745)
A path ends with the unit turned to the packet's final facing, as 1.12.1 leaves it.

- A monster move that installs a path stores its final facing on the spline (`0x618840`-`0x6188a0`). Only a move with no path turns the unit on arrival.
- At the path's end, `0x61a882` writes the facing in this order:
  - Angle, as sent;
  - Target, the heading to where that unit stands (`0x61a8c1`), from the deck-local end on a transport;
  - Spot, through `0x47f220`.
- The turn runs through the facing smoother (`0x600cd0`), never a snap. The display facing resets only at create and reactivate.
- `heading_between` ports `0x47f220`'s fixed headings for a point under the unit.

Each change has a test that fails without it.

First diagnosed and drafted by @kalistoking in #2695.

Co-authored-by: kalistoking <148718830+kalistoking@users.noreply.github.com>

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 08:07:42 +07:00
Sam Sung c1507a281c Trade getters read the session live; its events fire at their packet (#2736)
The trade window reached the interface through a per-frame feed, so its events fired ahead of the frame's other packets and its getters read a VM copy. In 1.12.1 the trade status handler (`0x4bfa08`'s cases) signals inside the packet, and the getters read the session at the call.

- The getters read the session through the host. Every trade signal goes on a trade lane, stamped in its handler.
- A request's checks run inside BEGIN_TRADE, with the ignore list ahead of the object lookup (`0x4bf750`).
- Our slots 1-6 raise no TRADE_PLAYER_ITEM_CHANGED from the status (`0x4bf2b0`).
- A close waits behind the open it closes, cancel included (`0x4bf527`, `0x493365`).
- Status 12 prints its line before the close (`0x4bf88e`).
- A chat-kind line raised in a Lua call fires inside it (`0x496842` → `0x49a870`).

Each change has a test that fails without it. Part of #2168 and #2217.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 05:37:22 +07:00
Sam Sung 05075f092e Status lines, message frames, quest panels, page text and cache wipes (#2714)
Ten fixes, each with a test that fails without it.

- Status lines are cut at 255 bytes (`0x41a049`), banners too (`0x419f19`), and an empty line is dropped without raising the severity (`0x41a05f`).
- A message frame's `bytes=N` holds N−1 bytes. A negative N empties its lines, since `0x771692` tests only zero.
- The reward panel after a progress panel plays the completion chime (`0xbe081c`, `0x500d36`).
- A panel opens only for a held unit, game object or item (`0x500c16`-`0x500c35`).
- Readable pages are rewritten into their language for the reader (`0x49b560`).
- A page of 1024 bytes or more reads empty, as `0x4191b0` does at capacity 0x400.
- World entry wipes only the four unsaved caches (`0x555740`)., keeping saved asks.
- Two comments cite the right addresses.

Fixes #2580
Fixes #2690
Fixes #2692
Fixes #2694
Fixes #2696
Fixes #2700
Fixes #2701
Fixes #2710
Fixes #2711
Fixes #2712

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 18:28:42 +07:00
Sam Sung f65f4bf1b1 Grammar escapes, raid selection, world states and CVars follow 1.12.1 (#2708)
Fifteen UI API fixes.

- **Text and names.** FontString text, buttons, tooltips, names and bubbles apply the `|1`/`|2` grammar escapes (`0x7716f0`). Rank names count code points.
- **Raid.** The raid roster selection stores the member's guid, survives a /reload, and clears at world login.
- **World states.** Each world-state packet fires WORLD_MAP_UPDATE then UPDATE_WORLD_STATES at its place.
- **Events.** DISPLAY_SIZE_CHANGED fires below scale 0.64. UPDATE_CHAT_COLOR carries the caller's name.
- **CVars.** Four refuse what 1.12.1 refuses, and anisotropic and ErrorLevel print its console lines.
- **Calls.** GuildSetLeaderByName("target") sends no name. Repair costs read by row position. Quest reward slots count to the first empty one. OfferPetition checks its eight guards.
- **Glue and errors.** The glue VM has the file calls. Widget methods share one wrong-receiver text.


Fixes #2507
Fixes #2557
Fixes #2559
Fixes #2567
Fixes #2568
Fixes #2581
Fixes #2588
Fixes #2593
Fixes #2599
Fixes #2606
Fixes #2615
Fixes #2623
Fixes #2630
Fixes #2687
Fixes #2688

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 15:59:50 +07:00
Sam Sung c5fc904f8c Cursor and cast drops, arrival target clear, loot and chat follow 1.12.1 (#2699)
Thirteen fixes to the cursor, world arrival, loot and chat.

- Losing control (`0x495901`) or a world port drops the cursor and the cast, inside the packet.
- Every arrival clears the target (`0x490927`), just before the world-entry events.
- A resolved roll frees its loot row, and a group coin loot prints its share line.
- A boss whisper becomes a whisper, and channel chat carries its instance number.
- The delete confirm names an uncached item.
- Bag books send CMSG_READ_ITEM and handle both replies.
- The spellbook pickup and drop sounds play.
- The quest log's gold guide arrow shows, cleared first on each select (`0x4def39`).
- A cleared loot row records its `Deviation:`.

Each change has a test that fails without it.

Fixes #2573
Fixes #2576
Fixes #2446
Fixes #2578
Fixes #2584
Fixes #2577
Fixes #2558
Fixes #2564
Fixes #2562
Fixes #2563
Fixes #2627
Fixes #2679
Fixes #2680

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 14:21:17 +07:00
Sam Sung cbd8e0fa68 Sorted particles, party snapshots, CVar floats and GetText follow 1.12.1 (#2691)
Seven issues from the UI core pass.

- Sorted particle emitters, with file flag 0x2 (`0x70fd1d`, `0x7b5d00`), now draw back to front. They use the reference's view-depth heap, so ties pop in its order (`0x7b3a5b`). Every other emitter keeps list order. (#2676)
- A party member leaving view snapshots the committed zone, `0xb4e314`, and their position at the call, as `0x5f0880` does. (#2677)
- GetDefaultLanguage answers nothing during a login's load (`0x49fcf0`). (#2665)
- GetGamma, the video getters and flat SavedVariables numbers read the CVar record's float (`0x63e135`). (#2673, #2672)
- The engine's counted and gendered text calls the Lua GetText and GetPluralIndex (`0x703bf0`, `0x703cf0`). Part of #2666.
- The pet cooldown test no longer depends on wall-clock time. (#2670)

Each change has a test that fails without it.

Fixes #2676
Fixes #2677
Fixes #2665
Fixes #2673
Fixes #2672
Fixes #2670

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 11:27:06 +07:00
Sam Sung 403f999892 GM tickets, cursor casts, hover, gossip and plate flashes follow 1.12.1 (#2685)
What differed from 1.12.1:
- **Ticket results** show their lines: create and update codes 1, 3 and 5, a fetch status of 0 and a failed delete (`0x5e4432`, `0x5e44ff`). Update text is cut at 1999 bytes (`0x5efacd`).
- **UPDATE_TICKET** clamps a negative age to 0 and passes the client's NaN and denormal bits for the no-ticket answer. Arguments the client fills from stack residue are a `Deviation:`.
- **Ticket status** 2 sends the no-ticket answer; status 3 fires GMSURVEY_DISPLAY (`0x5e78f0`).
- **Casting** reads the cursor first: a held spell goes through pickup, and anything else is cleared (`0x4b3310`).
- **Hover:** Disable fires OnLeave first, Enable fires OnEnter after (`0x779160`).
- **Gossip:** leaving the world resets the gossip lists (`0x4e1f60`).
- **Nameplates:** a name flashes red for 5 seconds on damage (`0x7cba77`).

Each fix has a test.

Fixes #2462 Fixes #2472 Fixes #2476 Fixes #2478 Fixes #2481 Fixes #2484 Fixes #2536

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 08:55:25 +07:00
Sam Sung ad0fd89729 Lua getters answer what their 1.12.1 handlers answer (#2663)
Lua getters that answered what 1.12.1 never does now read what their handlers read:
- **Bind area.** GetBindLocation and the `$z` spell token fall back to HOME_INN (`0x507f3a`).
- **Craft.** GetCraftName answers the trade-skill slot by craft type (`0x4f601c`).
- **Trainer.** The skill line and requirement come from the service's spell (`0x4d9261`, `0x4d94d6`).
- **Map.** GetPlayerMapPosition takes any unit token; GetMapInfo answers its sizes.
- **Mail.** GetInboxItem gates by quality and misses uncached items (`0x4af721`).
- **Pets.** Stabled pets pack in list order, the summoned one by its byte's bit 1 (`0x4cabe3`). UnitCreatureFamily reads any unit's record.
- **Gates.** HasFullControl and UseAction gate as the client's do; ItemTextGetItem answers nil with no text open.

Each fix has a test.

Fixes #2475 Fixes #2497 Fixes #2499 Fixes #2508 Fixes #2509 Fixes #2510 Fixes #2511 Fixes #2513 Fixes #2514 Fixes #2515 Fixes #2516 Fixes #2519 Fixes #2523 Fixes #2524 Fixes #2525 Fixes #2528

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 05:04:00 +07:00
Sam Sung 92c8d2d400 Comments cite the right addresses and the facts their rulings rest on (#2641)
Comments that cited the wrong client address, or stated a fact the bytes contradict. Each one was re-read at the bytes and corrected. Comments only: no code changes.

Citations: the MCLQ cell read is `0x68b21f`, not the WMO group reader. The portrait bake has one caller, `0x713540`. Camera mode 0 keeps facing the target. The survey id call is `0x474064`, the macro setter `0x494f80`, and the empty party list jump `0x49e08e`. The clock constructor sets six fields to -1 and one to 0. A statusbar reads a numeric string as its number.

Deviation comments: each now gives the reference fact its ruling rests on, with every ruling kept. Examples: SavedVariables are kept as .bak (`0x51f794`), only flag-0x10 emitters sort (`0x7b3a1b`), the buff expiry cache clears at game entry (`0x4e40c0`), and SetTexture keeps the previous image (`0x7702ac`).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 03:04:23 +07:00
Sam Sung f304e3a10a A drunk player's honor title takes their real gender, a deviation (#2452)
The honor line's rank title took the active player's gender from `PLAYER_BYTES_3` byte 0, while every other gendered text read the real gender. 1.12.1's `CGPlayer_C::GetGender` (`0x5ed5b0`) does read that byte whole for the active player. But the byte also carries the drunk bits (`gender | drunk & 0xFFFE` on vmangos), so a heavily drunk female reads as male.

Now the honor line reads the real gender (`UNIT_FIELD_BYTES_0` byte 2) like the rest. One `Deviation:` line on `unit_gender` names the reference's read and why benilla differs. The byte-0 getter is gone.

Test: a female with byte 0 full of drunk bits gets the female rank title. It fails on main.

Fixes #2103

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 08:29:18 +07:00
Sam Sung fa947ea2e4 Account data syncs with the server, as 1.12.1 does (#2447)
Key bindings, macros, the window layout and the chat setup stayed on the machine and never synced with the server. 1.12.1 keeps eight sections both on disk and on the server, in step by digest. At each world entry the server's digests (`SMSG_ACCOUNT_DATA_MD5`) meet each section's own and the cached one (`0x5afa10`). A section changed here goes up 30 seconds after the interface shutdown that wrote it (`0x5aff40`), and one changed there is asked for and stored.

Now benilla does the same, with the four wire bodies byte-exact. Two recorded deviations keep data the reference would lose: no truncated upload (`0x5afb42`), and no write on a bad download (`0x5afcbc`). `SaveBindings` now writes the set it stored, not the live table at drain.

Tests: wire goldens, the section check and transfer, and the timers. A live round trip against the local server came back byte-equal.

Fixes #1337
Fixes #2368

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 07:50:09 +07:00
Sam Sung 19af95006b Unattended logins answer a PIN from WOW_PIN or WOW_PIN_TOTP (#2386)
An unattended login (`WOW_USER` plus `WOW_PASS`) could not answer a PIN-protected account's keypad, so it waited forever.

Two variables now answer it. They go through the same path as the keypad's `PINEntered`, with the same prompt check and the same state report:
- `WOW_PIN`: the digits, as typed.
- `WOW_PIN_TOTP`: a base32 secret. Its RFC 6238 code (HMAC-SHA1, 30 s step, 6 digits) is the PIN, the scheme vmangos verifies (`AuthSocket.cpp:1274`). The code is derived at each prompt, re-dials included.

Setting both is refused, and neither value is ever logged. The variables are documented under "Running it unattended".

Tests: the RFC 6238 vectors, a leading-zero code, each variable answering the prompt, both set refused, and fresh codes on a mocked clock. A live fixed-PIN login against vmangos passed.

Fixes #2371

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 09:46:06 +07:00
Sam Sung 2c81c47998 The login dialog walks every logon state, as 1.12.1's does (#2369)
The login dialog jumped from Connecting straight to Authenticated, because the logon ran as one blocking step and reported nothing in between.

1.12.1's logon object reports its states as it reaches them, and the dialog shows each one's text (`0x836b40`):
- 3 as the challenge goes out (`0x5b2196`);
- 9 on a reply that asks for no PIN, or 7 for one that does (`0x5b1cd7`);
- 2 once the proof is sent (`0x5b1f93`).

The logon now reports each stage through its callback as it goes, and the glue sets the state from it.

Tests: the engine's stage order with and without a PIN, and the dialog's walk on both paths.

Fixes #2362

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 04:50:49 +07:00
Sam Sung 7a403d0506 PIN-protected accounts can log in, as in 1.12.1 (#2367)
PIN-protected accounts can log in, as in 1.12.1.

- **The challenge:** a non-zero security byte (`0x5bab5a`) carries the grid seed and salt. The logon reports the PIN state, and the stock keypad opens on `PLAYER_ENTER_PIN` with the grid built as `0x5b1e70` does.
- **`PINEntered`** takes 4 to 10 keys (`0x46d1c0`). It builds the proof, `SHA1(client salt ‖ SHA1(server salt ‖ digits))` (`0x5b31e0`), and sends it after the security byte (`0x5bbc80`).
- **A refused PIN** shows the PIN texts 8, 8, then 9 (`0x5b2d00`); a success resets the count.
- **The realm-list re-dial** forgets the PIN after a refusal rather than retrying into the server's lockout. The PIN is never logged.

Byte-exact goldens cover the proof and the grid. A fake realmd checks the proof as vmangos does (`AuthSocket.cpp:1204`).

Fixes #1110

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 03:03:35 +07:00
Sam Sung 39f6ba866d Getters ask for missing records inside their call, as 1.12.1's do (#2366)
The Lua getters' record asks go out inside their call, on a miss, as 1.12.1's do. The query reaches the wire in call order, with the reference's owner guid.

- **The getters:** summon confirm, battlefield position, ammo texture and quality, item cooldown, `SetBagItem`/`SetInventoryItem`, trainer, quest item, craft, trade skill and the quest log lookups. Each uses its own callback and dedupe (`0x48b6e1`, `0x4ac118`, `0x4c83bc`, `0x6e2efb`, `0x4d907e`, `0x5017ce`, `0x4f75dd`, `0x4fdb90`, `0x4e05d1`).
- **The owner guid:** the player for ammo, the active player for cooldown, `0xb0000000:spell` (the taught spell for trainers) for craft, trainer and trade skill, the partner for trade, 0 for the quest log.
- **Window show** asks nothing; only the getters do (`0x4f60c0`, `0x4d7d40`).

Byte-exact goldens pin the query bodies, and each getter has an in-call order test.

Part of #2202

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 02:33:57 +07:00
Sam Sung 308ca91d9e Pick, plates and minimap follow what the scene drew, as 1.12.1 (#2355)
What the scene drew and what the camera looks at now decide plates, the mouse pick and the minimap, as in 1.12.1.

- **Mouse pick:** static doodads occlude it with their drawn opaque meshes, not their hulls (`0x69cdb0`, mode 2 of `0x7089c0`).
- **Plates:** a plate needs its unit drawn last frame (`0x6704c0`). Under far sight, plates centre on the camera's object, and there are none when it isn't a unit (`0x60f77c`).
- **Far sight:** `SMSG_CLEAR_FAR_SIGHT_IMMEDIATE` ends it (`0x5e43f8` → `0x5ee590`).
- **Minimap:**
  - the interior window keeps its z until x/y leave it or the group changes (`0x6d952c`);
  - party and pet dots and the group rim arrows have tooltips (`0x4eb33c`, `0x4eb42d`).
- **Tutorials:** Equippable Items skips ammo and quivers (`0x809200`).

Each fix has a test that failed before it.

Fixes #756
Fixes #2341
Fixes #2342
Fixes #2343
Fixes #2344
Fixes #2345
Fixes #2347

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 21:51:12 +07:00
Sam Sung 359eff416a Template caches persist between sessions, as 1.12.1's do (#2352)
Item, object, quest and text records are kept between sessions, as 1.12.1 keeps its template caches.

- **Which stores persist:** each store's constructor sets a persist byte at `+0x39`. The creature, game object, item name, item, NPC text, quest, page text and item text stores are saved. The name, guild, pet-name and petition stores are session-only and cleared at world entry (`0x555740`).
- **The file:** one per store per realm under `benilla-config/cache/`, in the reference's layout, header-checked (build, locale, record size), with a hit sending no query (`0x5586ca`). The records are the server's answer bytes, decoded on load by the live decoder.
- **The item-name store** answers `CMSG_ITEM_NAME_QUERY` (`0x559fe0`), and item-set member names read it.
- **Cleanup:** the old creature-only file is removed on load, and three comments that called the name caches persistent are corrected.

Tests cover every store across a session, header mismatches, eviction and the live packet path.

Fixes #85

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 20:34:38 +07:00
Sam Sung bc59b5d17a Transports follow 1.12.1's clock, seating and crossing (#2348)
Ships and zeppelins follow 1.12.1's clock, seating and crossing.

- **The clock:** only a ship's create sets it, anchored at the packet's arrival (`0x5f7080`). The worldport reseek is gone, and a re-create keeps the anchor (`0x466350`).
- **Worldports:** an off-map ship stays frozen in view (`0x5f5274`), and a worldport keeps only the ridden ship (`0x401bc0`).
- **Crossings:** a crossing draws its route (`0x5f54c2` → `0x407de0`).
- **Seating:** a login seats us in the deck's frame, on a game object only (`0x630a80`). A rider stays aboard while inside the deck's volume (`0x630ba0`), and a gone transport ends the seat (`0x5f4fb0`).
- **Party pet portraits:** an out-of-view party pet's portrait probes the display cache (`0x525cb0`).

Each change has a test that failed before it.

Part of #1220

Fixes #1218
Fixes #1219
Fixes #1222
Fixes #645

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 18:48:05 +07:00
Sam Sung e94ef2f798 World pick, cursor and object use follow 1.12.1 (#2332)
- Over open ground the classifier's no-cursor exits clear to the base mode (`0x523d30`), so the repair and wrap cursors stay.
- While targeting, hover and click skip `IsSelectable` (`0x4828f4`, `0x4935d5`). An object is picked only for a word in `0x4800` that the lock test passes (`0x6e62e0`, `0x5f8260`), keys (effect 59) included.
- Object use refuses dead, locked out, mounted or shapeshifted, in combat and immune in `0x5f3130`'s order, with columns read by the object's own type. An auto-closing door at rest opposite its start says the object is in motion (`0x5f42f0`).
- `SMSG_GAMEOBJECT_PAGETEXT` opens the reader on the object's page (`0x5f88c0`), with a byte-exact golden.
- The interior trace keeps the nearest hit across every building (`0x6a8840`), with the portal tie as a fraction of the ray (`0x6be421`).

Each fix has a test that fails without it.

Fixes #436
Fixes #680
Fixes #677
Fixes #1710
Fixes #1711
Fixes #91
Fixes #2146

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 12:53:04 +07:00
Sam Sung 83cd8e7bd8 Window closes and dialog verbs act inside their calls (#2331)
About 35 Lua verbs queued their sends and events for a drain after the chunk; 1.12.1 acts inside the call.

- The NPC window closes (bank, trainer, auction, gossip, mail, merchant, stable, trade, taxi, trade skill, craft, quest) run their cores in the call, and fire CLOSED twice while the window held the latch (`0x493310`).
- Battleground, death, duel, loot roll, binder, summon, instance and PvP verbs send and signal in the call, with their gates: `RepopMe` only dead or a ghost (`0x605f30`), `AcceptXPLoss` in the healer's range (`0x5df7c1`), `PurchaseSlot`'s money and count (`0x4f86b0`).
- `AcceptAreaSpiritHeal` and the time packet rescan before acting (`0x4923b0`).
- The positions getters read the last packet with no slot gate (`0x4abf09`, `0x4ac1c6`).
- A unit is dead at health 0 or below (`0x605f3b`).

Each system has a test mixing its verb with `RandomRoll`, which fails without the change.

Part of #2202
Fixes #2321

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 12:11:57 +07:00
Sam Sung 32b4d437d7 Spell text, cast gates, ranges and missiles follow 1.12.1 (#2312)
Spell text, per-level terms, cast gates, ranges and travelling missiles answered or drew differently from 1.12.1.

- `$c` and `$p` expand (`0x6e31b0`, `0x6e3300`). A weapon spell's level reads the wielded weapon's skill (`0x5ea5d0`), and skill lines are indexed by race and class (`0x6de040`).
- The validator refuses a known learn, a pet's unlearnable spell and a second pet locally (`0x609854`, `0x609fd7`).
- A ranged spell's max range takes the ranged-slot item's scale (`0x6e36aa`).
- The launcher flies a ground cast as one missile at its point, and spawns none without a missile visual or ammo (`0x6e8a50`, `0x6e8a7f`). A reflected missile turns back at its caster (`0x61e17b`). Launch timing and the victim clips follow `0x61cfda` and `0x61d784`.

Tests fail on main, and the GO decode has a golden.

Fixes #2042
Fixes #2049
Fixes #1202
Fixes #683
Fixes #2069
Fixes #2070
Fixes #62

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 08:01:54 +07:00
Sam Sung f7ed694f6e Camera, swim pitch, sound and name-check verbs follow 1.12.1 (#2311)
Camera, swim-pitch, sound and name-check verbs were inert or answered differently from 1.12.1.

- `MoveView*` drive the camera's keyboard axes, and `ToggleMouseMove` toggles mouselook (`0x50fd40`, `0x50f910`).
- `CameraOrSelectOrMoveStop(1)` keeps the camera where it was left (`0x50f940`), and a customised view arms no auto-return (`0x50fc30`).
- The pitch keys pitch a swimmer and send the pitch moves (`0x515010`), and mouselook sends `MSG_MOVE_SET_PITCH` and `MSG_MOVE_SET_FACING` under the 0.1 rad throttle (`0x60e1ea`).
- `PlaySound` finds type-2 rows only (`0x45c306`). `PlaySoundFile` plays on bus 3, two at a time.
- Server-pushed music has its own slot (`0x460520`), and a repeat of a duplicate-flagged track is refused at its open (`0x7a66a0`). Zone silences use `0x460100`'s fixed point.
- Every VM checks names against the client's word lists (`0x402b7f`).

Tests fail on main, and the pitch body has a golden.

Fixes #1190
Fixes #1642
Fixes #1651
Fixes #1615
Fixes #1617
Fixes #49
Fixes #2116
Fixes #1694
Fixes #1689
Fixes #1139

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 06:52:59 +07:00
Sam Sung 8f137c077f Pet token, aura gates, world entry and zone PvP follow 1.12.1 (#2301)
Several unit, aura and world-entry answers came from the wrong source or at the wrong moment.

- `"pet"` is the player's charm, else summon (`0x515a5e`), not the pet bar. The pet's buffs go through `UnitBuff`'s unit gate (`0x5195aa`), and other units' auras through `RequiredAuraVision` (`0x519860`).
- `SetPetGuid` signals in place, in its order (`0x4bc84f`-`0x4bc90c`). World entry clears the pet guid and asks for pet info (`0x4bc6f0`, opcode 0x279).
- World entry always signals `UPDATE_BONUS_ACTIONBAR` (`0x4e5018`). `PLAYER_LEVEL_UP` and the level tutorials fire from `SMSG_LEVELUP_INFO` (`0x5e413e`).
- `GetZonePVPInfo` answers at the call (`0x48d540`), and the zone commit waits for our player (`0x5db95d`). After a live worldport into Stormwind, main answered nil inside `ZONE_CHANGED_NEW_AREA`; this answers friendly.

Tests fail on main. The 0x279 golden is byte-exact.

Fixes #2252
Fixes #261
Fixes #262
Fixes #2228
Fixes #1158
Fixes #2293

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 02:09:07 +07:00
Sam Sung 38cdd6401e Cursor, equip, bank and vendor verbs gate and wait as 1.12.1 does (#2298)
The cursor, equip, container and vendor verbs gated, waited and sent differently from 1.12.1.

- A swap that asks the bind-on-equip question keeps the item held, and asks inside the call (`0x5e0c40`). An uncached record parks the equip and replays it when the record arrives (`0x5e0dbe`, `0x5e17a0`, `0x5e1020`). `USE_BIND_CONFIRM` fires inside the use (`0x5d9222`).
- A split stack is equipped or swapped whole, since `0x5e1480` and `0x4c7300` never read the split count.
- An enchant on an uncached item gates on zeroed fields (`0x495d60`).
- Bank slots read empty to the container and inventory verbs while no banker is open (`0x6228a0`).
- A vendor row dropped on a bank bag buys into it (`0x4f9f32`), and `CMSG_BUY_ITEM` ends with 1 (`0x4fb933`).

Tests go through the verbs and fail on main. The vendor golden is byte-exact.

Fixes #2249
Fixes #2251
Fixes #2250
Fixes #2246
Fixes #2248
Fixes #2247
Fixes #2227

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 23:25:40 +07:00
Sam Sung 8c94412274 Seven window verbs follow 1.12.1's reads, caps and events (#2286)
Seven window verbs read, keep and fire what 1.12.1 does:
- `QueryAuctionItems` takes its text through `lua_tostring`, `usable` as a number's `_ftol` sent as a byte, and quality -1 for a non-number (`0x4ce9cd`-`0x4cec32`).
- `GetInboxInvoiceInfo` needs the item entry (`0x4af3e8`), names an uncached item "" (`0x5d8b25`), and reads its body as `sscanf` with zeroed outputs and no return test (`0x4af440`-`0x4af471`).
- The who list reads names and guilds at the `0x30`/`0x60` caps and keeps a short answer (`0x5ae013`-`0x5ae0c1`).
- The gossip greeting expands once per message (`0x4e229a`).
- A trainer's headers are built per list (`0xb73a14`).
- The repair flag alone fires no `MERCHANT_UPDATE`.
- A staged guild rank survives a roster reload (`0x4d0a37`).

Each has a test that fails without its fix.

Fixes #2214
Fixes #2220
Fixes #2222
Fixes #2262
Fixes #2263
Fixes #2264
Fixes #2245

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 13:11:26 +07:00
Sam Sung e8f5a47368 Combat log, monster chat and loot lines follow 1.12.1 (#2279)
Combat log, monster chat and loot lines now follow 1.12.1's rules.

- An aura update writes every loss before any gain, with flags masked `& 0xe`. Stack lines print only for a `StackAmount` above 1.
- Dispel lines check only the bearer, which must be held and in range.
- A line whose item the server refuses is dropped.
- Melee `UNIT_COMBAT` carries the school of the swing's first sub-damage block.
- Monster lines expand against the addressee alone (`0x49daab`). `$R` and `$C` name a creature. A held unit whose name is missing reads `UNKNOWNOBJECT` (`0x609210`). At most 64 lines wait for a name, oldest dropped first (`Deviation:`).
- Loot-roll and item-received lines read their GlobalStrings templates, with the roll's property word, a signed count, and another member's push (`0x491d9f`).

Each rule has a test that failed before the fix.

Fixes #2075
Fixes #2074
Fixes #2092
Fixes #1587
Fixes #206
Fixes #356
Fixes #352
Fixes #369

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 08:39:19 +07:00
Sam Sung 09c44a47a6 Item links, suffixes, makers and wrapped items follow 1.12.1 (#2274)
The item Lua API answers links, suffixes, makers and repair costs as 1.12.1 does.
- `GetInventoryItemLink`, `GetContainerItemLink` and `GetTradePlayerItemLink` answer nothing for an empty slot, and a white, nameless link for an uncached item (`0x4c8c56`, `0x52ae00`).
- Inspected crafted gear shows its maker line, read from the slot's creator (`0x5333cd`, `0x52e1d5`).
- `GetItemInfo` names an item with its link's random suffix through `ITEM_SUFFIX_TEMPLATE`, and keeps signed link numbers (`0x5d8b00`, `0x842d4c`); every item name uses that one format.
- A gift-wrapped item hides the roll of the item inside and costs nothing to repair (`0x5d8bc9`, `0x5da387`).

Tests pin each address. Built on macOS.

Fixes #2174
Fixes #2175
Fixes #1543
Fixes #282
Fixes #1160

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 06:55:02 +07:00
Sam Sung e95a29b868 One live reputation store; at-war and rank changes follow 1.12.1 (#2265)
One live reputation store: the wire, the pane's verbs and the reaction read and write the same slots, as the client's one array does (`0xb73290`).
- `FactionToggleAtWar` and the inactive verbs write the store inside their call, so `UnitReaction` and `UnitCanAttack` on the next line answer the new reaction (`0x4d5fd0`, `0x60640c`).
- `SMSG_SET_FACTION_ATWAR` copies the at-war bit (`0x4d56b0`). A standing message sets it below Unfriendly and clears it only on a rise (`0x4d5833`, `0x4d583f`).
- A rank change refreshes the player's reactions and sweeps the units, once per message (`0x4d5905`, `0x606f20`).
- `UPDATE_FACTION` fires per message, as the four handlers do.
- Logout zeroes all 64 slots (`0x4d541f`).

Tests pin each address. Built on macOS.

Fixes #2240
Fixes #77
Fixes #1410

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 02:35:45 +07:00
Sam Sung b63b2bb1a0 Console commands and CVars follow 1.12.1; Lua's date and time are local (#2257)
The console commands and CVar behaviours 1.12.1 has, and Lua's local time.
- `date` and `time` use the local zone, `time{}` by `_mktime`'s sum (`0x740811`, `0x740836`); screenshots and the logon challenge's bias follow.
- In fullscreen `GetCVar("gxResolution")` answers the screen's own size; the windowed size is what is saved.
- The twelve world commands (`0x66f6c0`), with `showDetailDoodads` gating the clutter and `waterRipples` the wakes.
- `quit`, `ver`, `setmap`, `showplayer` (`0x6400e0`, `0x4049e0`) and `SkySunGlare` (`0x6d1dc0`).
- `ffx`, `ffxGlow`, `ffxDeath` and `ffxRectangle` print enabled or disabled (`0x6cde30`).
- `widescreen` 0 gives the four 4:3 modes and a 4:3 portrait aspect.

Tests pin each address. Built on macOS; Linux and Windows compiled.

Fixes #2231
Fixes #2232
Fixes #1628
Fixes #1641
Fixes #1667
Fixes #2098
Fixes #1687
Fixes #1665
Part of #1577

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 23:28:59 +07:00
Sam Sung 6115f6bb20 Pet bar, unit, cooldowns and stable follow 1.12.1; verbs act in the call (#2254)
The pet bar, pet unit, portrait, cooldowns and stable follow 1.12.1, and the pet and stable verbs send inside their call (Part of #2202).
- Pet cooldowns from `SMSG_PET_SPELLS` start back-dated through `0x6e2c60`, with only bit 31 masked (`0x4bdaab`).
- Feeding casts first and binds the food only on success (`0x6ea266`); `DropItemOnUnit` takes any token naming the pet (`0x48da6c`).
- `CastPetAction` presses empty slots, drops a held action and plays its sound (`0x4be330`).
- A pet with no object exists, unseen, with an empty portrait (`0x4e80cb`, `0x51a0ce`).
- `UNIT_COMBAT` fires once per token naming the unit (`0x494600`).
- A pet rename evicts the name cache by pet number (`0x604ac6`).
- `UnstablePet` and the stable drops send to the stored master, as `0x4caf20` does.

Tests pin each address. Built on macOS.

Fixes #2161
Fixes #1598
Fixes #298
Fixes #180
Fixes #2006
Fixes #340
Fixes #187
Fixes #1414

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 22:11:20 +07:00
Sam Sung b493903e54 Trainer, taxi and merchant windows act as 1.12.1's do (#2233)
The trainer, flight-master and merchant windows now follow 1.12.1, and their verbs act inside their call (Part of #2202).
- **`IsTalentTrainer`** answers 1 with no trainer open (`0x4d8ed0`).
- **The trade-skill and learn-spell queries** read each service spell's effects (`0x4d9f70`).
- **`GetTrainerServiceAbilityReq`** counts a known higher rank as met (`0x4d96e0`).
- **Trainer rows** sort as the client's one persistent list, with a case-sensitive compare. The order is pinned against the client's own sort, run in benilla-re's emulator.
- **`CloseTaxiMap` and `TakeTaxiNode`** act in the call. A map with fewer than two known nodes shows `ERR_TAXINOPATHS` and opens nothing (`0x5ecf39`).
- **Buying an item a quest needs** shows its progress line (`0x5dced0`).
- **The merchant's sale and drop verbs** send as `0x4fb760` does.

Tests pin each address. Built on macOS.

Fixes #1272
Fixes #213
Fixes #212
Fixes #166
Fixes #2148
Fixes #2147
Fixes #1804

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 16:22:46 +07:00
Sam Sung 601438a77c Quest windows, log and gossip act as 1.12.1's do (#2229)
The quest windows, the quest log and gossip now follow 1.12.1, and their verbs act inside their call (Part of #2202).
- The quest log is ordered by the client's two `qsort` passes (`0x4de751`, `0x4dea63`), and collapse is keyed by group id.
- `GetAbandonQuestItems` lists the quest items an abandon destroys.
- `GetQuestLogRewardMoney` adds the level-60 money.
- `GetQuestReward` latches, so a double click sends one choice.
- An elite quest shows its tutorial.
- Rewards the player can't use read unusable, and an item of inventory type 0 reads quality -1.
- A coded gossip option asks for its code (`GOSSIP_ENTER_CODE`).
- A close drops the NPC inside its call (`0x501201`, `0x4e1fcc`).
- The gossip list reads at most 15 options (`0x4e2722`).

Tests pin each address, and a golden pins the code's bytes. Built on macOS.

Fixes #2194
Fixes #1508
Fixes #1507
Fixes #386
Fixes #385
Fixes #29
Fixes #1513

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:47:40 +07:00
Sam Sung 2766b03b9a The trade window opens, links, enchants and accepts as 1.12.1 does (#2223)
The trade window now follows 1.12.1, and the trade verbs act inside their call (Part of #2202).
- The open leg folds held coins only for a trade started by a drop (`0x4bf5f1`), with one `PLAYER_TRADE_MONEY`.
- Bag, equipped and trade-slot links go through one path (`0x52ae00`), with the enchant and suffix.
- `ClickTargetTradeButton(7)` with an enchant asks before replacing one (`TRADE_REPLACE_ENCHANT`), then casts at the partner's slot.
- Dropping or clicking an item onto a player starts or fills a trade (`0x48d960`, `0x4925d0`), and a refused placement changes nothing.
- The accept packet carries the partner's status word.
- The accept and un-accept signals fire before their packets.
- The money events fire where `0x4bf2b0` fires them.

Wire goldens pin the new bodies. Built on macOS.

Fixes #277
Fixes #279
Fixes #280
Fixes #281
Fixes #88
Fixes #292

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 08:51:10 +07:00
Sam Sung 1958f4fe32 The /who search, list and chat lines follow 1.12.1's builder (#2221)
The /who search, its list and its chat lines now follow 1.12.1, and the who and LFG verbs act inside their call (Part of #2202).
- The filter is built token by token, as `0x5aebb0` does. Tags match a case-insensitive substring of the localized zone, race and class names, the walk stops at the fourth term, and an unclosed quote drops its token.
- The sort order resets at each world entry (`0x5adc50`).
- An id with no row reads `UNKNOWN`, in the list and in chat.
- The answer keeps at most 50 entries (`0x5adf87`), and the count line gets the raw count.
- `GetWhoInfo`'s bounds and miss tuple match `0x5ad71a` and `0x5ad836`.

Three `Deviation:` lines name the memory and platform quirks not copied. Built on macOS.

Fixes #39
Fixes #1329
Fixes #1114
Fixes #181
Fixes #200

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 08:28:00 +07:00
Sam Sung 0689a07471 The mailbox reads, lists and sends mail as 1.12.1 does (#2219)
The mailbox now follows 1.12.1's inbox and send code, and the mail verbs act inside their call (Part of #2202).
- Expired mail stays listed.
- Mail from an ignored player is dropped on type 0 only.
- Delete and return use the reference's tests, and the postage sum matches.
- Reply follows `0x4aefa5`.
- `GetInboxText` reads the mail's template id, and `CMSG_MAIL_CREATE_TEXT_ITEM` now carries it, pinned byte for byte.
- A row with no paper takes the first usable one, in `0x4ada90`'s order.
- The send slot refuses as `0x4adf38` does.
- The profanity filter masks subjects and bodies.
- The header icons and non-player sender names come from the bytes.
- Keeping the wire id where the reference crashes on a null paper is a written `Deviation:`.

Tests pin each address. Built on macOS.

Fixes #1241
Fixes #1235
Fixes #247
Fixes #240
Fixes #55
Fixes #140

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 06:21:55 +07:00
Sam Sung 85ba44b4d5 Party and raid verbs act in their call with 1.12.1's gates and lines (#2218)
The party and raid verbs now act inside their call, as 1.12.1's do (Part of #2202). Their gates and lines now match the reference:
- `ConfirmReadyCheck` sends nothing once the deadline has passed (`0x4bb2f0`), and sends its answer as one byte (`0x4bc0bf`).
- `DoReadyCheck` works for the leader only, refuses while a check runs, and shows its start line in place.
- A ready check survives a `/reload`. Only the leader's roster leg closes it (`0x4bac5a`-`0x4bacb4`).
- `UninviteByName` uses its usage line (`0x48a610`), and so do `InviteByName` and the promote verbs.
- Name lookups answer their waits in the order they were asked (`0x55f426`).
- A groupmate's death shows `ERR_PLAYER_DIED_S` (`0x4e7f70`).
- A `/reload` seeds the group without firing group events.
- An invite fires its event, then shows its line (`0x5e6747`, `0x5e6752`).

Tests pin each address. Built on macOS.

Fixes #2122
Fixes #1436
Fixes #2200
Fixes #2183
Fixes #2208
Fixes #2022

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 04:52:46 +07:00
Sam Sung b888674377 The friends and ignore lists follow 1.12.1's FriendList (#2216)
The friends and ignore lists went wrong:
- Names showed blank, online friends came unsorted, and the list announced itself early.
- Several status results printed the wrong line or kept the wrong rows.
- The ignore list had no 25-slot cap, and an ignored player's emote still printed.

The reference:
- The list handler (`0x5ae350`) names a slot only from the cache, and signals at a pending count of 0.
- The CRT `qsort` with comparators `0x5ae870` and `0x5ae940` sorts the lists.
- Statuses follow the table at `0x5ace1c`, and refused names send their delete (`0x5acec8`, `0x5acf8c`).
- `SMSG_TEXT_EMOTE` drops an ignored sender (`0x49dc3d`).

The friend and ignore verbs act inside their call, and listeners see the list as signalled. Each fact is tested against its address.

Part of #2202

Fixes #133
Fixes #137
Fixes #138
Fixes #1109
Fixes #1112
Fixes #1113
Fixes #1668
Fixes #1769
Fixes #1328
Fixes #765

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 03:20:51 +07:00
Sam Sung 98e0a93496 Auction commands, results and notices act as 1.12.1's do (#2213)
Auction commands went wrong:
- A bid or cancel was sent with no local check.
- Results showed the wrong line or none.
- Notices re-queried instead of editing the lists, and the list verbs sent unarmed.
- Outbid auctions never reached the Bids tab.

The reference:
- `PlaceAuctionBid` and `CancelAuction` refuse in the call (`0x4cf762`-`0x4cf8a8`, `0x4d0338`).
- The result table `0x4cc7b4` maps 1 through `0x622630`, 4 to `0x17` and 13 to `0x1be`, and 5 always shows `0x175`.
- Notices remove through `0x4cdfe0`, and patches signal one event each, in the handler.
- The one-shot flags `0xb7263c`/`0xb72640` gate the list verbs.

Every auction verb but the close now acts inside its call. Each fact is tested against its address.

Part of #2202

Fixes #47
Fixes #48
Fixes #252
Fixes #1525
Fixes #1526
Fixes #1527
Fixes #1533
Fixes #2195
Fixes #2196
Fixes #2197
Fixes #2198

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 01:43:58 +07:00
Sam Sung 591358af1b Auction lists sort, count down and refuse sells as 1.12.1's do (#2193)
Auction lists went wrong:
- They kept the server's order until a header click, and re-sorted every frame.
- Time Left, High Bidder, Lvl and Seller sorted on the wrong keys, and names matched case.
- Time left froze at arrival, and expired rows stayed.
- The sell slot took items 1.12.1 refuses.

The reference:
- World entry seeds eight-key sort stacks (`0x4cc236`). A page sorts once, when its last item record lands (`0x4cc9e8`).
- The comparator `0x4cd940` and the CRT `qsort` (`0x73f727`) order the rows, ties included.
- Time left counts down from the deadline, and rows 10 s past it leave the lists (`0x4cdfe0`).
- The sell slot refuses in `0x4ce362`'s order.

benilla now has one CRT `qsort`, which the frame batches, macros, guild roster and addon list share. Each fact is tested against its address.

Fixes #260
Fixes #428
Fixes #253
Fixes #254
Fixes #255
Fixes #256
Fixes #1539
Fixes #258
Fixes #1524
Fixes #2191

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 19:18:37 +07:00
Sam Sung 86ef431dec Verbs apply inside their call, and packet events fire in wire order (#2184)
A verb called from Lua, or a packet's event, applied a frame later, after the call or handler had returned. 1.12.1 applies each verb inside its call and fires each event at its packet.

What changed:
- Verbs apply inside the call: targeting, item picks, refused casts' log lines.
- A packet's chat items and field notices fire in wire order.
- Combat, unghost and death-tutorial events fire at their packets.
- Signals raised while something waits are replayed with the lock and cursor state they had.
- Loot picks and bind confirms are one call-ordered queue. `LOOT_BIND_CONFIRM` fires before its slot is stored (`0x4c290f`, `0x4c2917`).
- A forked script no longer panics on a lend, and two comments now match the reference.

Each order is tested against its address.

Fixes #1993
Fixes #2045
Fixes #2051
Fixes #1419
Fixes #2016
Fixes #1987
Fixes #1237
Fixes #2139
Fixes #797
Fixes #2094

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 16:20:34 +07:00
Sam Sung 802ecec668 Party and raid roster lines, getters and verbs follow 1.12.1 (#2182)
The party and raid roster answered and sent where 1.12.1 does not:
- Join and leave lines printed for names the cache did not hold.
- A raid joined with no roster never asked for its icons.
- The loot getters needed a group.
- `GetPartyLeaderIndex` answered 0 after a list with no leader.
- The subgroup verbs sent for a held subgroup or an uncached name.
- `UninviteFromParty` and `PromoteToPartyLeader` took only party1-4.

The reference:
- The party leave line asks the cache with no callback (`0x5e6d15`).
- Raid lines wait on theirs (`0x4bacd0`, `0x4bad30`).
- A first raid list sends `MSG_RAID_TARGET_UPDATE` 0xff (`0x4babf4`).
- The getters read the stored cells.
- The leader cell is zeroed by every list (`0x4e85b5`).
- Both verbs resolve any token (`0x515970`).

What changed: the roster follows each of those. Each is tested against its address.

Fixes #2000
Fixes #2001
Fixes #2003
Fixes #2086
Fixes #2087
Fixes #2088
Fixes #2089

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 15:52:07 +07:00
Sam Sung 3387c8225d Unit getters read the unit they name; item events fire for every player (#2176)
The unit getters answered for the player alone:
- Stat functions gave zeros past player and pet.
- `GetGuildInfo` failed on chained tokens.
- A group member out of view had no race, class or sex.
- `UnitRangedDamage` ignored the weapon's school.
- `UnitIsUnit` resolved equal strings first.
- `UNIT_INVENTORY_CHANGED` fired only for the player.
- Drunk thresholds printed nothing and left `UnitLevel` alone.
- `CanInspect` answered nil.

The reference:
- `UnitIsUnit` compares the strings first.
- The getters read the named unit's fields and the name cache.
- The visible-item watch (`0x51bc3c`) signals for every player holding a token.
- The drunk watcher (`0x5e2a90`) prints and lowers the level.

What changed: each getter reads the unit its token names. The item watches, the ammo callback (`0x4c84f0`) and the inspect view signal where the reference does.

Each fact is tested against its address.

Fixes #1544
Fixes #718
Fixes #1239
Fixes #1232
Fixes #2005
Fixes #169
Fixes #1408
Fixes #1157
Fixes #1409

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 13:41:28 +07:00
Sam Sung f6d2d44df8 Pet casts, CastSpellByName and two chat verbs run as 1.12.1 runs them (#2170)
A possessed unit's spell and a pet spell with AttributesEx4 0x20 went out as CMSG_PET_ACTION. `CastSpellByName` never found pet spells and misparsed names. `SendChatMessage` sent `%t` and `%n` unexpanded and passed any `|` escape. `RandomRoll` sent any arguments.

The reference:
- `CastSpellByName` cuts the name and rank at the first `(` and `)` and falls back to the pet's book (0x4b3950).
- A unit caster runs the cast ladder, picking its own target (0x6e4ef4) and ordering Attack after the send (0x6131a0).
- `SendChatMessage` expands the tokens and raises on a bad escape inside its call (0x49f1e0).
- `RandomRoll` checks its arguments first (0x48c7b0).

What changed:
- A `CMSG_PET_CAST_SPELL` writer with byte-exact goldens.
- The unit caster's ladder covers its pick, autoSelfCast and the cursor's binds.
- Both chat verbs now apply inside their calls.
- The channel slots follow every step.

Each fact is tested against its address.

Fixes #639
Fixes #168
Fixes #406
Fixes #1331
Fixes #1332
Fixes #1531

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 12:43:31 +07:00