OnPlayerConsumableEffectTick

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search

onPlayerConsumableEffectTick

AVAILABLE FROM UPDATE 0.1.3
This event is available in G1R:MP 0.1.3 and later. The contract below includes the compatibility guarantees introduced in that update.

Triggered after a periodic consumable tick successfully changes authoritative health or mana.

Availability

This event is available in server-side scripts.

Callback signature

onPlayerConsumableEffectTick(playerId, inventoryItemId, sequence, appliedHealth, appliedMana, ticksRemaining)

Parameters

Name Type Description
playerId int The player receiving the periodic effect.
inventoryItemId int The native numeric consumable ID that created the effect.
sequence int The consumable-use sequence that created the effect.
appliedHealth number The health change actually applied by this tick after clamping.
appliedMana number The mana change actually applied by this tick after clamping.
ticksRemaining int The number of scheduled ticks remaining after this tick.

Examples

Handle the event:

addEventHandler("onPlayerConsumableEffectTick", root, function(playerId, inventoryItemId, sequence, appliedHealth, appliedMana, ticksRemaining)
    outputDebugString("Consumable tick item=" .. inventoryItemId .. ", hp=" .. appliedHealth .. ", mana=" .. appliedMana)
end)

Notes

  • This read-only effect callback is part of the stable server-side Lua contract beginning with update 0.1.3.
  • The event is emitted only when at least one applied delta is non-zero. A scheduled tick clamped by full health or mana does not emit it.
  • A failed authoritative progression write is retried and does not emit this callback until the tick succeeds.
  • The values are already applied by the server. Do not apply them again from the handler.