Files
ClassicAPI/docs
Brues 1e91b5e033 feat(totem): add the totem1-totem4 unit tokens
"totem1" .. "totem4" now name the player's totem creature in each
totem slot (1 Fire, 2 Earth, 3 Water, 4 Air), so UnitGUID("totem1")
gives the slot's GUID and every other Unit* function works on it too.
GetTotemInfo keeps the 7 returns that retail has.

The token is a new branch in the existing hook on the token-to-GUID
resolver FUN_TOKEN_TO_GUID (0x515970), next to markN. All the Script_Unit*
globals, TargetUnit, IsUnitToken and the [@unit] macro conditions read
tokens through that one function, so they all accept it. The GUID comes
from Totem::Tracker, which finds the creature by its entry and
CreatedBy == player. The token is empty until the tracker finds that
creature.

Unit events reach the token the same way they reach markN: totemN is
appended to Unit::TokenEvents' token list, and the tracker calls
TokenEvents::Refresh when a slot gets its creature, when the creature
goes away, and when a recast replaces it. Refresh reruns the engine's
recompute FUN_UNIT_SCRIPT_RECOMPUTE, which sets or clears the
registration bit that makes the engine watch the unit's fields.
2026-11-15 14:03:03 -06:00
..
2026-05-07 15:08:45 -05:00
2026-05-07 15:52:48 -05:00
2026-05-10 00:10:06 -05:00
2026-05-07 16:28:32 -05:00
2026-05-07 12:23:57 -05:00
2026-05-07 15:08:45 -05:00
2026-05-07 15:08:45 -05:00
2026-05-09 14:23:40 -05:00