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

--脚本号
x101012_g_scriptId=101012

x101012_g_Iddaneng = 700001

x101012_g_BossPosList = {}
x101012_g_BossPosList[1] = {{127,110,0}}      
--事件交互入口
function x101012_OnDefaultEvent( scene,selfId ,targetId)
	-- body
	BeginEvent(scene)
	AddText(scene,"全隊試煉失敗的話可以找我重新進行試煉。")

	AddNumText(scene,x101012_g_scriptId,"重新開始",-2,0)
	EndEvent(scene)
	DispatchEventList(scene,selfId,targetId,true)
end




--事件列表选中一项

function x101012_OnEventRequest( scene,selfId,targetId,eventId ,index)
	-- body
	if index==0 then
			if GetCopySceneParam(scene, 2) == 0 then
			local objId = GetObjIdByRoleBase(scene, x101012_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,63002)
			end
			elseif GetCopySceneParam(scene, 2) ~= 0 then
				SendServerTips(scene, selfId, "#{50017}*", -1, false)
	    	end
		end


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

end