SetEventScript(object, int, string)
- The object to get the event script from.
- An EVENT_SCRIPT_* constant matching the event to set the script on.
- The script to attach to the event.
Sets the given event script for the given object and handler.
Returns 1 on success, 0 on failure.
Will fail if oObject is invalid or does not have the requested handler.
While this can set creature events for the PC, the only events that actually work on PCs are OnConversation, OnDeath, OnHeartbeat, and OnUserDefined. In development build 1.74.8171, OnCombatRoundEnd, OnPerception, and OnSpellCastAt now work for PCs as well.
|constants:||EVENT_SCRIPT_* Constant Group|