#include "cas_casinoinc"

void CasinoNotification(string sMessage);

void main()
{
    // Get the player character who triggered the event
    object oEnteringPC = GetEnteringObject();

    // Check if the entering object is a player character
    if (!GetIsPC(oEnteringPC)) return;

    // Retrieve the name of the variable from the trigger's local string
    string sVariableName = GetLocalString(OBJECT_SELF, "VariableName");

    // Check if the variable name is I_AM_IN_HOLE
    if (sVariableName == "I_AM_IN_HOLE")
    {
        // Retrieve the value of the variable from the trigger
        int nVariableValue = GetLocalInt(OBJECT_SELF, "VariableValue");

        // Assign the value to the entering player character
        SetLocalInt(oEnteringPC, sVariableName, nVariableValue);

        // If the value is 1, send a casino notification
        if (nVariableValue == 1)
        {
            CasinoNotification("The hole is now occupied...");
        }
    }
}
