FANDOM


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

/////////////////////////////////////////////////////////////////////////////
//
// file:
//      osrs_opa
//
// purpose:
//      OnPhysicalAttacked 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)
    {
        ////////////////////////////////////////      creature
        case I_OSRS_EVENT_CLASS_CREATURE:
            // Creature::OnPhysicalAttacked Pre-event
            if (!osrs_c_opa_pre())
            {
                return;
            }

            // Creature::OnPhysicalAttacked event
            if (!osrs_c_opa())
            {
                return;
            }

            // Creature::OnPhysicalAttacked post-event
            osrs_c_opa_post();

            break;



        ////////////////////////////////////////      placeable
        case I_OSRS_EVENT_CLASS_PLACEABLE:
            // Placeable::OnPhysicalAttacked Pre-event
            if (!osrs_p_opa_pre())
            {
                return;
            }

            // Placeable::OnPhysicalAttacked event
            if (!osrs_p_opa())
            {
                return;
            }

            // Placeable::OnPhysicalAttacked post-event
            osrs_p_opa_post();

            break;



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

            // Door::OnPhysicalAttacked event
            if (!osrs_d_opa())
            {
                return;
            }

            // Door::OnPhysicalAttacked post-event
            osrs_d_opa_post();

            break;



    }
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.