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.
SYSEVENT_SPEECH
ID#:
0x00000001
Explanation
This event comes in two types: Normal and Unicode. The latter is sent when the source is a client speaking in Unicode speech.
Struct Members:
Name
Type
type
SYSEVENT_SPEECH (0x00000001)
source
Character Reference
text
string normal text (junk if unicode)
texttype
type of speech: "yell", "whisper", "emote", or "default"
uc_text
(Unicode only) a "Unicode array" of 2-byte "Big Endian" integers corresponding to the unicode characters sent. will be an 'error' type if the Unicode input is "bad". will be uninitialized if no Unicode text is available (ie, when a non-Unicode client types the command)
langcode
(Unicode only) string 3-character, uppercase language code, i.e. "ENU", "DEU", etc.
When sent:
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.
Ranged?
Yes
SYSEVENT_ENGAGED
ID#:
0x00000002
Explanation
Combat Engaged event.
Struct Members:
Name
Type
type
SYSEVENT_ENGAGED (0x00000002)
source
Character Reference
When sent:
When an attack is initiated against an NPC. (set opponent, or Target with the Harmful flag set)
Ranged?
No
SYSEVENT_DISENGAGED
ID#:
0x00000004
Explanation
Combat Disengaged event.
Struct Members:
Name
Type
type
SYSEVENT_DISENGAGED (0x00000004)
source
Character Reference
When sent:
When an attack is stopped against an NPC. (set opponent null, attacker dies)
Ranged?
No
SYSEVENT_DAMAGED
ID#:0x00000008
Explanation
The NPC was damaged.
Struct Members:
Name
Type
type
SYSEVENT_DAMAGED (0x00000008)
source
Character Reference, or 0 if no character source
damage
integer damage amount
When sent:
The NPC recevied damage.
Ranged?
No
SYSEVENT_ENTEREDAREA
ID#:
0x00000010
Explanation
A character entered inside a range around the NPC. Note, ignores Z distance.
Struct Members:
Name
Type
type
SYSEVENT_ENTEREDAREA (0x00000010)
source
Character Reference
When sent:
The mobile walked into the range, a new NPC was created inside the range, or a character un-hid inside the range.
Ranged?
Yes
SYSEVENT_LEFTAREA
ID#:
0x00000020
Explanation
A character left the range around the NPC. Note, ignores Z distance.
Struct Members:
Name
Type
type
SYSEVENT_LEFTAREA (0x00000020)
source
Character Reference
When sent:
The mobile walked out of the range. Not sent if mobile hides, dies, or deleted.
Ranged?
Yes
SYSEVENT_OPPONENT_MOVED
ID#:
0x00000040
Explanation
The NPC's opponent moved.
Struct Members:
Name
Type
type
SYSEVENT_OPPONENT_MOVED (0x00000040)
source
Character Reference
When sent:
The NPC's current opponent moved. Inhibits the Enter/Leave events for the NPC's opponent.
Ranged?
No
SYSEVENT_HOSTILE_MOVED
ID#:
0x00000080
Explanation
Not Implimented.
When sent:
Not Implimented
Ranged?
No
MERCHANT
SYSEVENT_MERCHANT_BOUGHT
ID#:
0x00000100
Explanation
Only sent to the merchant NPC that bought the items.
Struct Members:
Name
Type
type
SYSEVENT_MERCHANT_BOUGHT (0x00000100)
source
Character Reference
amount
amount of gold items sold for
When sent:
After an NPC merchant buys items from a player
Ranged?
No
SYSEVENT_MERCHANT_SOLD
ID#:
0x00000200
Explanation
Only sent to the merchant NPC that sold the items.
Struct Members:
Name
Type
type
SYSEVENT_MERCHANT_SOLD (0x00000200)
source
Character Reference
amount
amount of gold items sold for
When sent:
After an NPC merchant sells items to a player.
Ranged?
No
SYSEVENT_ITEM_GIVEN
ID#:
0x00000400
Explanation
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.
Struct Members:
Name
Type
type
SYSEVENT_ITEM_GIVEN (0x00000400)
source
Character Reference
item
Item Reference
When sent:
A player drops an item on an NPC.
Ranged?
No
GHOST SPEECH
SYSEVENT_GHOST_SPEECH
ID#:
0x00000800
Explanation
Allows the NPC to receive double-click events (i.e. for mounting horses, pack llamas, etc.)
Struct Members:
Name
Type
type
SYSEVENT_DOUBLECLICKED (0x00000800)
source
Character Reference
When sent:
A player double-clicked on an NPC.
Ranged?
No
SYSEVENT_GHOST_SPEECH
ID#:
0x00001000
Explanation
Dead players generate this event when speaking, not SYSEVENT_SPEECH. Otherwise, see SYSEVENT_SPEECH for the struct members.
When sent:
A dead player speaks.
Ranged?
Yes
AUX Connect
AUX Connection Receive Event
ID#:
n/a
Explanation
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.
Struct Members:
Struct Members:
Name
Type
type
string "recv"
value
unpacked scripting object
When sent:
When an external application connected to an AUX handler script sends packed data, wait_for_event() will return this struct.
Ranged?
Yes
Last updated
Was this helpful?