void main()
{
    // Get the entering object
    object oEnter = GetEnteringObject();

    // Check if the entering object is a player character
    if (GetIsPC(oEnter))
    {
        // Set the variable to indicate they are in the arena stands
        SetLocalInt(oEnter, "IAmInArenaStands", 1);

        // Check if the player has the item with the tag I_CAS_STAFF_KEY
        object oKey = GetItemPossessedBy(oEnter, "cas_staff_key");

        // Apply a spell failure effect only if the player does not have the key
        if (!GetIsObjectValid(oKey))
        {
            effect eSpellFailure = EffectSpellFailure(100, SPELL_SCHOOL_GENERAL); // 100% failure rate
            ApplyEffectToObject(DURATION_TYPE_PERMANENT, eSpellFailure, oEnter);
        }
    }
}
