NWNWiki
Advertisement
NWNWiki
3,718
pages

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

/////////////////////////////////////////////////////////////////////////////
//
// file:
//      osrs_oo
//
// purpose:
//      OnOpen 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::OnOpen Pre-event
            if (!osrs_p_oo_pre())
            {
                return;
            }

            // Placeable::OnOpen event
            if (!osrs_p_oo())
            {
                return;
            }

            // Placeable::OnOpen post-event
            osrs_p_oo_post();

            break;



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

            // Door::OnOpen event
            if (!osrs_d_oo())
            {
                return;
            }

            // Door::OnOpen post-event
            osrs_d_oo_post();

            break;



    }
}
Advertisement