OnMonsterTargetChange
Jump to navigation
Jump to search
onMonsterTargetChange
Triggered when server-owned monster AI changes its player target.
Availability
This event is available in server-side scripts.
Callback signature
onMonsterTargetChange(monsterId, previousPlayerId, targetPlayerId, sourceResource)
Parameters
| Name | Type | Description |
|---|---|---|
monsterId |
string |
The monster ID. |
previousPlayerId |
int |
The previous target player ID, if any. |
targetPlayerId |
int |
The new target player ID, if any. |
sourceResource |
string |
The resource associated with the change. |
Examples
Handle the event:
addEventHandler("onMonsterTargetChange", root, function(monsterId, previousPlayerId, targetPlayerId, sourceResource)
outputDebugString("Monster " .. monsterId .. " target=" .. targetPlayerId)
end)