--天墉城
-- 三环本大能对话

--脚本号
x101017_g_scriptId=101017

x101017_g_Iddaneng = 700002

x101017_g_BossPosList = {}
x101017_g_BossPosList[1] = {{127,110,0}}      
--事件交互入口
function x101017_OnDefaultEvent( scene,selfId ,targetId)
	-- body
	BeginEvent(scene)
	AddText(scene,"準備接受獸靈們的試煉吧")

	AddNumText(scene,x101017_g_scriptId,"開始試練",-2,0)
	EndEvent(scene)
	DispatchEventList(scene,selfId,targetId,true)
end




--事件列表选中一项

function x101017_OnEventRequest( scene,selfId,targetId,eventId ,index)
	-- body
	if index==0 then
			if GetCopySceneParam(scene, 2) == 0 then
			local objId = GetObjIdByRoleBase(scene, x101017_g_Iddaneng)
			local CurPoz = GetObjPosition(scene, objId)
			SetCopySceneParam(scene,2,1)		
			local nUserCount = GetSceneUserCount(scene)
			for i=0,nUserCount-1 do
				local nUserObjId = GetUserObjIdByIdx(scene,i)
				AcceptMission(scene,nUserObjId,65002)
			end
			elseif GetCopySceneParam(scene, 2) ~= 0 then
				SendServerTips(scene, selfId, "#{50017}*", -1, false)
	    	end
	    end


	--	SetCopySceneParam(scene,0,4)
	--	SetCopySceneParam(scene,1,0)

end