#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");
    if (sVariableName == "") return; // Exit if no variable name is set

    // 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);

    // Send a debug message to the player indicating what variable got assigned
 //   string sDebugMessage = "Assigned variable: " + sVariableName + " with value: " + IntToString(nVariableValue);
  //  SendMessageToPC(oEnteringPC, sDebugMessage);

    // Optionally, if the value of a specific variable triggers a notification, check and send it
    // This part remains specific, as you might want to handle certain variables differently
    if (sVariableName == "I_AM_IN_HOLE" && nVariableValue == 1)
    {
        CasinoNotification("<cU˙˙>The area is now occupied...</c>");
    }
}
