OnPlayerSpellCastCancel

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

onPlayerSpellCastCancel

Triggered when an active spell cast is cancelled.

Availability

This event is available in server-side scripts.

Callback signature

onPlayerSpellCastCancel(playerId, spellKey, spellId, castId, phase, result, rejectReason, targetPlayerId, phaseStartTimeMs, phaseDurationMs, manaAfter)

Parameters

Name Type Description
playerId int The casting player ID.
spellKey string The stable spell definition key.
spellId int The numeric spell ID.
castId int The unique cast sequence ID for this player.
phase string The authoritative cast phase.
result string The authoritative phase result.
rejectReason string The rejection reason, or an empty value when accepted.
targetPlayerId int The selected target player ID, if any.
phaseStartTimeMs int Server time at which the phase began.
phaseDurationMs int Expected duration of the phase in milliseconds.
manaAfter number Authoritative mana after this transition.

Examples

Handle the event:

addEventHandler("onPlayerSpellCastCancel", root, function(playerId, spellKey, spellId, castId, phase, result, rejectReason, targetPlayerId, phaseStartTimeMs, phaseDurationMs, manaAfter)
    outputDebugString("onPlayerSpellCastCancel: " .. spellKey .. " cast=" .. castId .. " phase=" .. phase)
end)

Notes

  • Use castId to correlate all phases, projectiles, impacts, and cleanup for one cast.