Function: GetWardAmountLeft()
Description: Reads an owned snapshot of the ward matching the current spell's ID on its primary entity target. Must run in a spell script. Extra arguments are ignored; they do not select a spell or target.
Parameters: None.
Returns: An unsigned damage budget, or no value (evaluates as nil) when the current spell, zone, primary entity target or ward is unavailable.
Ward and target lifetime: Target lookup acquires the actor under zone publication before checking its type or using it. Ward records have one owner; reads return value snapshots and mutations occur under the ward lock. A ward remembers its spell through a weak allocation control. Damage processing and notifications retain the acquired spell and actor owners, and notifications run after the ward lock is released so callbacks can remove or replace wards. See Lua actor lifetime.
Original spell targets: When this function uses a spell's target list, it snapshots references to the originally selected actor allocations. It skips unavailable or departed targets instead of selecting another actor with a reused runtime ID. Accepted actors remain physically retained through the active protected callback, including Lua errors; saved userdata and target records do not keep them alive between callbacks. Explicit Spawn arguments retain their existing selection behavior. See Lua actor lifetime.