# Hotbar cooldowns (staged 2026-10-03, TEST only, not published)

Report (Trevor): "we need to make the abilities on the tool bar go down when autoskills use them so we can see whats on
cd" and "the button doesnt stay down when crippling strike is on cd".

## Causes
* Skills: the RoF2 client starts a skill button's reuse timer only when the player presses it (UseSkill 0x45B2D0).
  When the server fires Kick/Bash/... (auto-skills), nothing tells the client, so the button stays up. Also, the
  stock client keeps ONE shared timer for all combat skills, while our server has one per family (kicks, bash,
  backstab, frenzy, monk strikes, taunt).
* AAs: the client stores only 100 AA timers (ids 0-99, profile+0x6BEC). It drops OP_AAAction for ids >= 100 and
  calls any AA whose timer id is >= 100 "always ready". The per-class remap (sql/aa_timer_remap.sql, already on prod)
  moved every class AA to ids 100-1699, so NO class AA button greys any more, whether you press it or an auto-AA
  fires it (Crippling Strike is one of them). All-class AAs (ids 0-99) still work. A server-only remap back under 100
  cannot work: a 3-class character can need 26 shared + up to 44 + 42 + 42 class timers = 154 > 100.

## Fix
* Server (test Code f4fb4a81f): every start of a family timer, manual or auto, sends
  `SKILLCD|total_ms|remaining_ms|skill,skill,..` (OP_HJUIData); zone-in sends all families.
* DLL (client_dll ee3eedb, build df6d6ad): skills named by the server get their own timer (CSkillMgr getters
  0x5BACA0/0x5BAD40/0x5BAE40 hooked, setters mirrored), so each button greys with the sweep for its own family. AA timer
  ids 100-1999 are kept from OP_AAAction and IsAbilityReady 0x4A3880 is answered the stock way for them (hot button +
  AA window).
* Also on test (fedc85099, Custom:KickBashUseWeaponMagic): Kick / Round Kick / Flying Kick / Bash count as magic when
  the primary weapon is magic (no boots needed vs. spurbone skeletons), and auto-skills skip a skill that would only
  land as INVULNERABLE.

Files: dinput8.dll (md5 5fb9a20e0ed808fd2823ce19a88299d7). verify_sites.py: 37 hooks + 40 bytes-only checks +
2 call sites, 0 problems against patch_files/eqgame.exe, clients/everquest_rof2_tanks and clients/thj_latest.
Built on top of the live DLL (540a0c6 sneakhide, md5 5aa21452 = current patch_files/dinput8.dll).

## Test on the desktop (TEST world)
1. Trevor's desktop already runs the hoardinspect / psfill DLL builds, which contain these changes (client_dll
   573095a / d48c19c are on top of df6d6ad); then skip this step. Otherwise:
   scp -r openclawvm:heroes_journey_workspace/patcher/staged_hotbarcd /tmp/ && bash /tmp/staged_hotbarcd/install_desktop.sh
2. Launch "EverQuest RoF2 Tanks (Direct)" (NOT the Patcher launcher: it puts the live DLL back). Log in to the test world.
3. hjclient.log near the top: "...+sneakhide+hotbarcd) loaded", hooks SkillLastUsed, SkillTimerDur, SkillIsAvailable,
   SkillSetLastUsed, SkillSetTimerDur, AAIsAbilityReady "ok". After zone-in: "hotbar cooldowns: reset (OP_PlayerProfile)"
   and "hotbar cooldowns: first SKILLCD line ...". (A "SKIP ..." line = that part is off; send the log.)
4. Skills: put Kick, Bash (with a shield), Backstab etc. on a hotbar, turn auto-skills on, auto-attack a mob.
   Each button goes grey with the refresh sweep when the server fires it, and comes back when it is ready.
   Kick and Bash now have separate timers (Bash right after Kick works; before, the buttons shared one timer).
   Pressing a button by hand still works and greys at once.
5. AAs: Crippling Strike (or any class AA) on a hotbar: press it, the button stays down for its reuse, the AA window
   shows the time left. Same when auto-AAs fire it. Zone: the cooldowns are still shown after zoning.
6. Kick vs. spurbone skeletons (immune to non-magic melee): a character with no boots and a magic primary weapon
   kicks for damage. With a non-magic primary, auto-kick no longer fires (no INVULNERABLE spam; the button stays up).
Undo: bash /tmp/staged_hotbarcd/install_desktop.sh --revert (or run the Patcher launcher once).

## Publish (after Trevor confirms on test) - NOT run
1. cd ~/heroes_journey_workspace/patcher && D=~/.local/share/eq-backups/$(date +%F) && mkdir -p "$D" &&
   cp -p patch_files/dinput8.dll "$D/dinput8.dll.pre-hotbarcd"
2. md5sum patch_files/dinput8.dll   (expect 5aa21452...; if it changed, another DLL feature was published meanwhile:
   rebuild from client_dll HEAD instead of copying this one)
3. cp staged_hotbarcd/dinput8.dll patch_files/dinput8.dll && md5sum patch_files/dinput8.dll   (expect 5fb9a20e...)
4. news.txt, right under the welcome line:
   Oct 3: Hotbar buttons now show cooldowns for abilities your auto-skills use, and class AA buttons grey out again while on cooldown.
5. python3 generate_manifest.py, then check the dinput8.dll entry in patch_manifest.json against
   sha256sum patch_files/dinput8.dll.
The AA part works with the current prod server. The skill part needs the prod C++ (970f2162d + 68f1c01a3, shipping in
the combined prod kit deploy-combo); either order is safe. deploy-hotbarcd/deploy.sh is kept only as a reference for
that kit: do not run it.
