mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 16:10:36 +00:00
Fires with no payload when the item in inventory slot 16, 17 or 18 changes -- equip, unequip and swap alike. The narrow sibling of PLAYER_EQUIPMENT_CHANGED that swing-timer consumers want, so they no longer filter three slots out of a 19-slot event in Lua on every gear change. Blizzard's own Blizzard_SwingTimer registers this event. Rides the descriptor-field observers Player::Equipment already installs for PLAYER_EQUIPMENT_CHANGED -- the weapon slots are three of the 19 -- so there is no new hook, no second registration and no polling. The dispatcher invokes the callback only when a slot's item GUID actually changed, and seeds each node's mirror from live at registration, so login and /reload produce no fire. Coalesced to at most one fire per frame via a dirty flag drained on WorldTick: one action can change two weapon slots (a two-hander replacing a one-hander plus an off-hand) and the per-slot observer would otherwise fire twice for it. The drain checks the reservation slot before clearing the flag, so a change marked while the reservation is still unclaimed is held rather than swallowed. Slot 18 is exempted for the classes whose slot 18 is a relic slot -- a Libram/Idol/Totem is a passive stat item, not something you swing. Gated on the same data Script_UnitHasRelicSlot (0x00519E50) reads rather than a hardcoded class list: ChrClasses.dbc[class] + 0x40, verified in the disassembly at 0x00519EAE-0x00519EC0 and against the client's own ChrClasses.dbc, where that column is 1 for PALADIN/SHAMAN/DRUID and 0 for the other six. Read live, since the class-byte global is repopulated per character-enter. Not verified in-game yet: built and deployed only.