--天墉城
--答題环

--脚本号
x104002_g_scriptId=104002
--环任务id MissionRoundConfigId
x104002_g_missionRoundConfigId = 21
--任务最低等级
x104002_g_MinLevel=10
--活动id
x104002_g_MissionId=115
--事件交互入口
function x104002_OnDefaultEvent( scene,selfId ,targetId)
	-- body
	BeginEvent(scene)
	AddText(scene,"[43596b]答題答題，答對了有獎[-]")

	if IsMissionAccepted(scene,selfId,x104002_g_MissionId) then
		AddNumText(scene,x104002_g_scriptId,"答題",-2,0)
	end

	EndEvent(scene)
	DispatchEventList(scene,selfId,targetId,true)
end




--事件列表选中一项

function x104002_OnEventRequest( scene,selfId,targetId,eventId ,index)
	-- body
	if index==0 then

		if IsHaveRoundMission(scene,selfId,x104002_g_missionRoundConfigId) then

			if not IsSectionMax(scene,selfId,x104002_g_missionRoundConfigId) then
				ShowPuzzleNext(scene,selfId,x104002_g_missionRoundConfigId)
			else
				AcceptRoundMission(scene,selfId,x104002_g_missionRoundConfigId)
			end
		else 
			AcceptRoundMission(scene,selfId,x104002_g_missionRoundConfigId)
		end
	
	end
end