POL System Events
This document describes all the "System Events" (Sysevents) that the POL core uses. These are enabled in Control Scripts using the EnableEvents() function. Only these events listed here should be used in the EnableEvents() function. You may not define User Events with any of these values (or any of the reserved values in sysEvent.inc). To use a user event in your script, you must not use EnableEvents(), just send it using SendEvent() (or process_obj.sendevent()) and look for it normally in the receiving script. Some of the Sysevents below are ranged, meaning you may specify a world distance in EnableEvents() beyond which the script will not receive the event. Use DisableEvents() to disable any of the Sysevents.
08/31/2015
SYSEVENT_SPEECH
This event comes in two types: Normal and Unicode. The latter is sent when the source is a client speaking in Unicode speech.
0x00000001
When a player speaks in range of an item listening point, or NPC that has enabled the event. Note Ghost speech is a seperate event.
Yes
SYSEVENT_ENGAGED
Combat Engaged event.
0x00000002
When an attack is initiated against an NPC. (set opponent, or Target with the Harmful flag set)
No
SYSEVENT_DISENGAGED
Combat Disengaged event.
0x00000004
When an attack is stopped against an NPC. (set opponent null, attacker dies)
No
SYSEVENT_DAMAGED
The NPC was damaged.
0x00000008
The NPC recevied damage.
No
SYSEVENT_ENTEREDAREA
A character entered inside a range around the NPC or top-level item. Note, ignores Z distance.
0x00000010
The mobile walked into the range, a new NPC was created inside the range, or a character un-hid inside the range.
Yes
SYSEVENT_LEFTAREA
A character left the range around the NPC or top-level item. Note, ignores Z distance.
0x00000020
The mobile walked out of the range. Not sent if mobile hides, dies, or deleted.
Yes
SYSEVENT_OPPONENT_MOVED
The NPC's opponent moved.
0x00000040
The NPC's current opponent moved. Inhibits the Enter/Leave events for the NPC's opponent.
No
SYSEVENT_HOSTILE_MOVED
Not Implimented.
0x00000080
Not Implimented
No
SYSEVENT_MERCHANT_BOUGHT
Only sent to the merchant NPC that bought the items.
0x00000100
After an NPC merchant buys items from a player.
No
SYSEVENT_MERCHANT_SOLD
Only sent to the merchant NPC that sold the items.
0x00000200
After an NPC merchant sells items to a player.
No
SYSEVENT_ITEM_GIVEN
Item dropped on an NPC generates this event. Also sets the following cprops on the item: "GivenBy": PC's serial, "GivenTo":NPC's serial, "GivenTime":gameclock value when item was given.
Important: The item is moved to a storage area until the script handling the event moves it to a real container. If the item is not before by the time the event object goes out of scope (including passed to a subroutine! use 'byref' to prevent the event from being destroyed before it can be passed to the handling subroutine), the item will automatically be moved back to its old container, and the aformentioned cprops are erased.
0x00000400
A player drops an item on an NPC.
No
SYSEVENT_DOUBLECLICKED
Allows the NPC to receive double-click events (i.e. for mounting horses, pack llamas, etc.)
0x00000800
A player double-clicked on an NPC.
No
SYSEVENT_GHOST_SPEECH
Dead players generate this event when speaking, not SYSEVENT_SPEECH. Otherwise, see SYSEVENT_SPEECH for the struct members.
0x00001000
A dead player speaks.
Yes
SYSEVENT_GONE_CRIMINAL
The GONE_CRIMINAL event lets the system tell the NPC when a mobile has become a criminal (from a previously non-criminal state) by firing this event and placing a character reference to the new criminal in the source field of the event. If used in conjunction with the ENTERED_AREA system event, then guards should be able to do their guarding work without needing to do polling scans of the area around them periodically. On ENTERED_AREA events, you check to see if the person entering the area is a criminal or not. On GONE_CRIMINAL events, you know that the person who was already in the area has become a criminal from previously being innocent.
0x00002000
A player inrange has become a criminal.
Yes
AUX_Connection_Receive_Event
This event is the method by which the AUX connection script received data from an external application. (Data may be sent with aux_connection.send())
Note: ONLY received in AUX connection handler scripts.
n/a
When an external application connected to an AUX handler script sends packed data, wait_for_event() will return this struct.
Yes
SYSEVENT_TOKEN_SPEECH
Used for token speech if SeperateSpeechTokens is enabled in servspecopt.cfg.
0x00004000
Like SYSEVENT_SPEECH but only when tokens are present.
Yes
SYSEVENT_TOKEN_GHOST_SPEECH
Used for token speech if SeperateSpeechTokens is enabled in servspecopt.cfg.
0x00008000
Like SYSEVENT_GHOST_SPEECH but only when tokens are present.
Yes
SYSEVENT_BOAT_MOVEMENT
Used for boat piloting via mouse movement. Sent to a boat's control script.
0x00010000
When the boat's pilot uses mouse movement.
No