# Tier item name colours (staged 2026-09-29, Trevor test only)

dinput8.dll md5 61f13e4fff232e9b0373927c165430d3, built from client_dll/hjclient.c (previous source: hjclient.c.bak-tiercolor,
previous DLL 42386ff3 = click-to-mem + Ratio fix: client_dll/dinput8.dll.bak-tiercolor). Contains everything the 42386ff3
build had (clickmem, ratio, bots, ...) plus the tier colours. verify_sites.py (extended to check call sites):
30 hook/byte-patch sites + 1 call site, 0 problems, against patch_files/eqgame.exe (md5 e5ea76b0).

Tiers: item id = base + tier * 300000. Tier 1 Enchanted (300000-599999, names end " (Enchanted)" on test, " +1" on prod today) = light blue 0xFF4DA6FF.
Tier 2 Legendary (600000-899999, names end " (Legendary)" on test, " +2" on prod today) = gold 0xFFFFD700. Everything else = stock colour.

## Where
1. Item display window, the item-name line (the one that is green now). New hook 0x6A9540, THJ's own target for the
   same feature. The colour replaces the stock white/green only: an item you cannot use keeps the stock red
   (purple = usable class but not equippable now), same as THJ, so "can't use" stays visible. By item id.
2. Item hover tooltips (inventory, bags, bank, loot and merchant slots). Call-site retarget at 0x867BD0 (the tooltip
   drawer's one text call). By NAME: the tooltip is the bare item name and has no id, so the name ending decides:
   " (Enchanted)" / " (Legendary)" (test, generate_tiers.py) or " +1" / " +2" (prod until migrated). For names of
   60+ chars a cut-off suffix down to " (Enchant" / " (Legenda" still counts; anything shorter gets no colour. No base item in the items table ends that way today (checked); if a future base item did, its tooltip
   would be coloured too. THJ did not colour tooltips; this is ours.
3. Advanced Loot window (/advloot): the item-name cell of each row, by item id (our own list, no hook).
Not done: chat item links. THJ's dsp_chat detour does not touch links (checked their 1000f280), and the link colour
lives inside the STML renderer; left stock.

## Kill switch
/tiercolor off | /tiercolor on | /tiercolor (toggle). Session only (ON at every game start). The item window and
tooltips follow at once (re-open the item); loot rows keep the colour they were added with.
Log: hjclient.log "hook ItemDispNameColor @006a9540 ok", "call TipTextColor @00867bd0 ok", and per item window
"tiercolor: item <id> tier <n> name <old> -> <new>" (tooltips do not log: they draw every frame).

## Test (Trevor)
Restart the game (the DLL is loaded at start). Check hjclient.log for the two lines above and "24/24 hooks installed",
"1/1 call sites retargeted".
- Inspect a normal item: name line green/white as before; hover: white tooltip.
- Inspect an Enchanted (+1) item: blue name line; hover it in a bag: blue tooltip.
- Inspect a Legendary (+2) item (Vixeun on the test world wears Legendary gear: inspect her, or her items): gold.
- An item your class cannot use keeps the red name line (by design, as THJ).
- /advloot with a tier drop: blue/gold item name in the row.
- /tiercolor off, re-open an item: stock colours again.
- Chat link: unchanged (not implemented).

## Promote
cp dinput8.dll ../patch_files/dinput8.dll && cd .. && python3 generate_manifest.py
(then remove dinput8.dll from Trevor's patcher_ignore.txt if he wants the patcher to manage it again).
Revert Trevor's client: mv dinput8.dll.bak-tiercolor dinput8.dll in /home/tj/Desktop/everquest_rof2_tanks
(that backup is the shipped 213d0907 build that was installed there).
