Tranquilla_not_First_Introduction=false
A_SIDE12_CHECK_Unnamed2_Triggered=false
A_SIDE12_CHECK_Unnamed2_Complished=false
Tranquilla_not_First_Mentioned_Task=false
RipanWinkle_First_Introduction_Triggered=false
function onTalk()
    --一些基础设置
    disableMovement()
    local dialog_choice=1
    --获取是否第一次与其对话
    Tranquilla_not_First_Introduction=getFlag("Tranquilla_not_First_Introduction")
    if Tranquilla_not_First_Introduction==false then
        setFlag("Tranquilla_not_First_Introduction",true)
        say("Tranquilla_Introduction")
    else
        A_SIDE12_CHECK_Unnamed2_Triggered=getFlag("A_SIDE12_CHECK_Unnamed2_Triggered")
        A_SIDE12_CHECK_Unnamed2_Complished=getFlag("A_SIDE12_CHECK_Unnamed2_Complished")
        Tranquilla_not_First_Mentioned_Task=getFlag("Tranquilla_not_First_Mentioned_Task")
        RipanWinkle_First_Introduction_Triggered=getFlag("RipanWinkle_First_Introduction_Triggered")
        --如果已经触发了任务而且还没有完成任务，同时Tranquilla第一次提及该任务的提示
        if A_SIDE12_CHECK_Unnamed2_Triggered==true and A_SIDE12_CHECK_Unnamed2_Complished==false and Tranquilla_not_First_Mentioned_Task==false then
            setFlag("Tranquilla_not_First_Mentioned_Task",true)
            say("Tranquilla_Tips")
        --否则进入选择项
        else 
            --还没有遇到过RipanWinkle，Tranquilla已提及任务但是还未完成
            if RipanWinkle_First_Introduction_Triggered==false and Tranquilla_not_First_Mentioned_Task==true and A_SIDE12_CHECK_Unnamed2_Complished==false then
                dialog_choice=choice("Tranquilla_UI_1","Tranquilla_UI_2","Tranquilla_UI_3","Tranquilla_UI_5","Tranquilla_UI_6")
                if dialog_choice==1 then
                    say("Tranquilla_Introduction")
                elseif dialog_choice==2 then
                    say("Tranquilla_Review_Comus")
                elseif dialog_choice==3 then
                    say("Tranquilla_Review_Quakerish")
                elseif dialog_choice==4 then
                    say("Tranquilla_Tips")
                end
            --还没有遇到过RipanWinkle，Tranquilla已提及任务且已完成
            elseif RipanWinkle_First_Introduction_Triggered==false and A_SIDE12_CHECK_Unnamed2_Complished==true then
                dialog_choice=choice("Tranquilla_UI_1","Tranquilla_UI_2","Tranquilla_UI_3","Tranquilla_UI_6")
                if dialog_choice==1 then
                    say("Tranquilla_Introduction")
                elseif dialog_choice==2 then
                    say("Tranquilla_Review_Comus")
                elseif dialog_choice==3 then
                    say("Tranquilla_Review_Quakerish")
                end
            --还没有遇到过RipanWinkle，Tranquilla还未提及过任务
            elseif RipanWinkle_First_Introduction_Triggered==false and Tranquilla_not_First_Mentioned_Task==false then
                dialog_choice=choice("Tranquilla_UI_1","Tranquilla_UI_2","Tranquilla_UI_3","Tranquilla_UI_6")
                if dialog_choice==1 then
                    say("Tranquilla_Introduction")
                elseif dialog_choice==2 then
                    say("Tranquilla_Review_Comus")
                elseif dialog_choice==3 then
                    say("Tranquilla_Review_Quakerish")
                end
            
            --已经遇到过RipanWinkle，Tranquilla已提及任务但是还未完成
            elseif RipanWinkle_First_Introduction_Triggered==true and Tranquilla_not_First_Mentioned_Task==true and A_SIDE12_CHECK_Unnamed2_Complished==false then
                dialog_choice=choice("Tranquilla_UI_1","Tranquilla_UI_2","Tranquilla_UI_3","Tranquilla_UI_4","Tranquilla_UI_5","Tranquilla_UI_6")
                if dialog_choice==1 then
                    say("Tranquilla_Introduction")
                elseif dialog_choice==2 then
                    say("Tranquilla_Review_Comus")
                elseif dialog_choice==3 then
                    say("Tranquilla_Review_Quakerish")
                elseif dialog_choice==4 then
                    say("Tranquilla_Review_RipanWinkle")
                elseif dialog_choice==5 then
                    say("Tranquilla_Tips")
                end
            --已经遇到过RipanWinkle，Tranquilla已提及任务且已完成
            elseif RipanWinkle_First_Introduction_Triggered==true and A_SIDE12_CHECK_Unnamed2_Complished==true then
                dialog_choice=choice("Tranquilla_UI_1","Tranquilla_UI_2","Tranquilla_UI_3","Tranquilla_UI_4","Tranquilla_UI_6")
                if dialog_choice==1 then
                    say("Tranquilla_Introduction")
                elseif dialog_choice==2 then
                    say("Tranquilla_Review_Comus")
                elseif dialog_choice==3 then
                    say("Tranquilla_Review_Quakerish")
                elseif dialog_choice==4 then
                    say("Tranquilla_Review_RipanWinkle")
                end
            --已经遇到过RipanWinkle，Tranquilla还未提及过任务
            elseif RipanWinkle_First_Introduction_Triggered==true and Tranquilla_not_First_Mentioned_Task==false then
                dialog_choice=choice("Tranquilla_UI_1","Tranquilla_UI_2","Tranquilla_UI_3","Tranquilla_UI_4","Tranquilla_UI_6")
                if dialog_choice==1 then
                    say("Tranquilla_Introduction")
                elseif dialog_choice==2 then
                    say("Tranquilla_Review_Comus")
                elseif dialog_choice==3 then
                    say("Tranquilla_Review_Quakerish")
                elseif dialog_choice==4 then
                    say("Tranquilla_Review_RipanWinkle")
                end
            end

        end

    end

    

end

function onEnd()
    enableMovement()
end