function getCounter(key)
    return engine.Scene.Session:GetCounter(key)
end

function setCounter(key, value)
    return engine.Scene.Session:SetCounter(key, value)
end

function onTalk()
    disableMovement()
    say("GREENcontest25_grog_challenge"..arguments)

    choiceDialog({
        {"GREENcontest25_grog_yes", onChosen = function (ctx)
            setFlag("ChallengeActive_"..arguments, true)

            enableMovement()
            makeUnskippable()

            if arguments == 'A' or arguments == 'B' or arguments == 'C' or arguments == 'I' then
                setCounter("challengeTimer", 120)
            end

            closeChoiceDialog()
        end},
        {"GREENcontest25_grog_no", onChosen = function (ctx)
            closeChoiceDialog()
            setCounter("challengeTimer", 0)
        end}
    })

    
end

function onEnd(room, wasSkipped)
    enableMovement()
end