--天墉城
--答题环

--脚本号
x101006_g_scriptId=101006
--环任务id MissionRoundConfigId
x101006_g_missionRoundConfigId = 20
--任务最低等级
x101006_g_MinLevel=30
--活动id
x101006_g_ActivityId=17
--事件交互入口
function x101006_OnDefaultEvent( scene,selfId ,targetId)
	-- body
	BeginEvent(scene)
	AddText(scene,"[43596b]答題答題，答對了有獎[-]")

	AddNumText(scene,x101006_g_scriptId,"答題（30級）",-2,0)
	EndEvent(scene)
	DispatchEventList(scene,selfId,targetId,true)
end




--事件列表选中一项

function x101006_OnEventRequest( scene,selfId,targetId,eventId ,index)
	-- body
	if index==0 then
		if not IsActivityTimeLimited(scene,selfId,x101006_g_ActivityId) then
			if GetLevel(scene,selfId) >=x101006_g_MinLevel then
				if IsHaveRoundMission(scene,selfId,x101006_g_missionRoundConfigId) then

					if not IsSectionMax(scene,selfId,x101006_g_missionRoundConfigId) then
						ShowPuzzleNext(scene,selfId,x101006_g_missionRoundConfigId)
					else
						AcceptRoundMission(scene,selfId,x101006_g_missionRoundConfigId)
					end
				else 
					AcceptRoundMission(scene,selfId,x101006_g_missionRoundConfigId)
				end
			else 
			--等级不足
			SendServerTips(scene,selfId,"#{31003}")
		end
	else
			--时间不到
			SendServerTips(scene,selfId,"#{31008}")
		end
	end
end