NWNWiki
Advertisement
NWNWiki
3,718
pages

The osrs_ol script is used by the Open Source Rule Set to handle the OnLock event. The content of the script is the following.

/////////////////////////////////////////////////////////////////////////////
//
// file:
//      osrs_ol
//
// purpose:
//      OnLock event script.
//
/////////////////////////////////////////////////////////////////////////////

// the include file for Open Source Rule Set events
#include "osrs_inc"

/////////////////////////////////////////////////////////////////////////////
void main()
{
    // determine what type of object is calling this script
    int iCallingClass = osrs_GetCallerEventClass(OBJECT_SELF);
    switch(iCallingClass)
    {
        ////////////////////////////////////////      placeable
        case I_OSRS_EVENT_CLASS_PLACEABLE:
            // Placeable::OnLock Pre-event
            if (!osrs_p_ol_pre())
            {
                return;
            }

            // Placeable::OnLock event
            if (!osrs_p_ol())
            {
                return;
            }

            // Placeable::OnLock post-event
            osrs_p_ol_post();

            break;



        ////////////////////////////////////////      door
        case I_OSRS_EVENT_CLASS_DOOR:
            // Door::OnLock Pre-event
            if (!osrs_d_ol_pre())
            {
                return;
            }

            // Door::OnLock event
            if (!osrs_d_ol())
            {
                return;
            }

            // Door::OnLock post-event
            osrs_d_ol_post();

            break;



    }
}
Advertisement