Commit Graph
1 Commits
Author SHA1 Message Date
Brues a005002ca9 feat(model): the scene camera shakes; PlaySpellVisual at a table of targets
Camera shakes. A 1.12.1 kit names a SpellEffectCameraShakes row at +0x38;
the kit player plays it once per play (0x0060EE2E) through
PlaySpellEffectCameraShakes (0x006ECB40), which adds each of the row's
three CameraShakes ids with CameraAddShake (0x00511D40): the row's type,
axis, amplitude times 1/36, frequency, duration, pre-roll and decay, kept
with the position and the clock (0x00511C60). A dynamic object's $SHK
event adds the row its payload names at the event's point (0x005D5920 to
0x005D592B). Each frame the camera's walk (0x00511760) ages them (ms * 0.001
plus the pre-roll, gone at the duration), cuts each by its distance from
the eye (0x005116E0: whole within 9 yards, nothing past 80, times
0.7^((d - 9) / 9) between, the double 0.7 at 0x00808AD0), keeps the
strongest per axis, and evaluates it (0x00511610: A sin(2 pi t f), times
exp(-t k) for type 1; axis 0 along the heading, 1 across, 2 up). The
driver adds the sum to the eye (0x0050EDCC); the view never turns.

model/SceneShake.cpp does this per scene on the scene clock, so a paused
scene holds its shakes. Paint adds the offset to the eye it draws the sky,
world, models, decals and beams from; the projection stays unshaken. The
kits a scene plays (casts, SetSpellVisualKit, ApplySpellVisualKit, aura
visuals) and a spell area's $SHK shake it. The heading is the scene
camera's, the world's being the followed unit's facing. A kit's shake
plays at the actor: the client plays it from the first effect node's
position, which a bone-attached node has not filled yet (read at
0x00620E0E, filled at 0x0062101D), so a kit like Thunder Clap's 356 shakes
at the world origin there and the camera drops it. The footstep (0x005FBF70)
and swing (0x00625C30) shakes stay off; stock scenes would shake.

A table of targets. A spell go carries a hit list: the cast kit plays once,
the launcher makes one missile per hit (0x006E8A50), and without missiles
the instant impact walks the list (0x006E8BF0). PlaySpellVisual now takes a
table of actors as that one cast: the first is the cast's target, each
other gets a sibling cast with the same ID and its own missile, or its
impact at once, and OnSpellVisualImpact runs for each target. The siblings
join the cast list after the step that made them, as a step holds a
reference into it. Each missile still starts its own flight loop through
PlaySoundLoop3D (0x004589A0), as in the world.
2026-11-11 15:48:31 -06:00