OnNpcAttack
onNpcAttack
AVAILABLE FROM UPDATE 0.1.5
This event is available in G1R:MP 0.1.5 and later. The contract below includes the compatibility guarantees introduced in that update.
Reports an NPC attack impact against a player.
Availability
This event is available in server-side scripts.
Callback signature
function(npcId, targetPlayerId, damage, actionId)
Parameters
| Name | Type | Description |
|---|---|---|
npcId |
int |
Attacking NPC. |
targetPlayerId |
int |
Player receiving the impact. |
damage |
number |
Applied damage (may be zero). |
actionId |
int |
Melee action / ranged action / magic cast ID. |
Notes
- Listen with addEventHandler(eventName, root, handler). Server observation/event, not client authority.
- Not an attack-start event. Includes melee and projectile impacts; do not apply damage again in the handler. A miss/world impact need not emit this event.
- See NPC scripting and Update 0.1.5.