User Tools

Site Tools


Scripting Events

Scripting events have 3 properties:

  1. The Moment and Condition in Which They Are Called (Event Name)
  2. The Event System Used (Event Type)
    This determine how to register the event and access the parameters.
  3. The Script to Execute
    This is your script or someone else script that you registered to a specific event to perform a specific behaviour on specific objects.

Event Systems

New Internal Events

Sinfar server side plugin adds many new events, they can be Script Based Events or Variable Based Events.

Here's the list of the new Variable Based Events:

Variable NameDescriptionCallerParametersReturn Value / BypassEvent() ResultExample
EVENT_CANUSECalled before determining if an item can be used or not.The Item0: The item possessorBoolean: Wether or not the item can be used (SetEventResultInt(TRUE or FALSE))scroll_w_canuse
EVENT_RECVITEMAn item is about to be added to an object inventoryThe object that will acquire the item0: The Item
1: The current item possessor
Boolean: Wether or not the item should be added to the caller's inventorymail_putinbox
EVENT_CLEARALLACTIONSCalled when an object actions list is about to be cleared.
It is one way to know when an action has been interrupted (for any reason)
The objectNoneNoneTODO
EVENT_PCENTEREDCalled when a PC has entered an area.AreaNoneNoneThis is actually called from the PC action queue.
EVENT_PCENTERAREACalled when a PC has entered an area.PCNoneNone
EVENT_AREALOADEDCalled when a PC has entered an area.AreaNoneNoneThis is called before the PC is actually moved to the new area, so GetArea() will not work. If the area is needed use EVENT_PCENTERED.
EVENT_PCLEAVEAREACalled when a PC has exited an area.PCNoneNone
EVENT_AREAUNLOADEDCalled when a PC has exited an area.AreaNoneNone
building/scripts/events.txt · Last modified: 2020/02/16 09:39 by EternalSenenity