--事件点触发 
--沙虫洞 
--global.CallScript(7223)

function m012_3()

	--开始剧情 
	func_start(3248,7482,0,1)	
	--修改旗标 
	flag.SetValue(6001,123) 

	local	i
	
	
	--夏侯澜辉
	npc.Create(1,1,2814,7331)
	npc.SetVisible(1,0)	
	npc.SetAt(1,0,1)
	npc.SetAnim(1,128)
	--瑕	
	npc.Create(2,2,2774,7294)
	npc.SetVisible(2,0)	
	npc.SetAt(2,1,0)
	npc.SetAnim(2,128)
	--姜承 
	npc.Create(3,3,2782,7354)
	npc.SetVisible(3,0)
	npc.SetAt(3,1,1)	
	npc.SetAnim(3,128)
	--暮菖兰 
	npc.Create(4,4,2846,7292)
	npc.SetVisible(4,0)	
	npc.SetAt(4,-1,-1)
	npc.SetAnim(4,128)
	--皇甫卓 
	npc.Create(6,6,2840,7330)
	npc.SetVisible(6,0)	
	npc.SetAt(6,1,0)
	npc.SetAnim(6,128)
	--绑定点
	npc.Create(1,18,2820,6900)
	npc.Create(1,19,2820,7060)
	npc.SetVisible(18,0)
	npc.SetVisible(19,0)
	
	--沙虫  
	npc.CreateFloat(250,16,2815,-472,7945)
	npc.SetAt(16,1,-1)
	npc.SetAnim(16,219)
	npc.SetVisible(16,0)
	--虫洞  
	npc.CreateFloat(4256,17,3048,-499,7727)
	-- npc.Create(4256,28,2820,6900)
	--飞行石  
	--初期 
	-- npc.CreateFloat(253,21,2788,-560,7027)
	-- npc.SetAt(21,-1,-1)
	npc.SetVisible(21,0)
	--后期 
	-- npc.SetPos3D(21,2788,-545,7027)		
	
	
	
	
	--黑屏时间长一点
	wt(2.5)
	
	
	
	
	
	--震动
	camera.Shake(999,3)
	--镜头1 
	camera.ResetLerp(0)		
	camera.ChangeCameraStatic(2898,-408,7057,2854,-446,6975)
	camera.ResetLerp(3000)			
	camera.ChangeCameraStatic(2960,-379,7187,2916,-405,7101)
	--淡入 
	effect.FadeIn(1,1)
	global.Wait(3)
	--慢镜头50%
	global.SetMotionSpeed(50)
	--喷出特效1 
	global.PlaySound(2019,100)
	npc.CreateSE(18,4340)	
	global.Wait(1)
	--拉镜头 
	camera.ResetLerp(400)			
	camera.ChangeCameraStatic(2960,-379,7187,2891,-353,7119)
	global.Wait(0.6)
	--慢镜头30%
	global.SetMotionSpeed(30)	
	--动态模糊  
	effect.MotionBlur(1)	
	--喷出特效2 
	npc.CreateSE(19,4337)
	global.Wait(0.6)
	--慢镜头50%
	global.SetMotionSpeed(50)		
	
	
	
	
	--镜头2 
	camera.ResetLerp(0)		
	camera.ChangeCameraStatic(3044,-229,7280,2975,-300,7292)
	camera.ResetLerp(6000)		
	camera.ChangeCameraStatic(2984,-383,7290,2908,-445,7308)
	global.Wait(0.5)
	global.PlaySound(2027,100)
	global.Wait(0.5)	
	--众人出现 
	npc.SetVisible(1,1)
	npc.SetVisible(2,1)
	npc.SetVisible(3,1)
	npc.SetVisible(4,1)
	npc.SetVisible(6,1)
	global.Wait(1)
	--震动停
	camera.Shake(0,0)			
	global.Wait(1)
	--慢镜头恢复  
	global.SetMotionSpeed(100)	
	global.Wait(1)
	--动态模糊关 
	effect.MotionBlur(0)		
	global.Wait(1)
	--淡出 
	effect.FadeOut(1,1)
	--音乐渐停  
	global.MusicFadeIn(2000,100,0)			
	global.Wait(2)	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	--npc位置 
	--夏侯澜辉
	-- npc.Create(1,1,3248,7482)
	npc.SetPos(1,3248,7482)
	npc.SetAt(1,0,1)
	npc.SetAnim(1,128)
	--瑕	
	-- npc.CreateFloat(2,2,3240,-500,7420)
	npc.SetPos3D(2,3240,-500,7420)
	npc.SetAt(2,-1,0)
	npc.SetAnim(2,128)
	--姜承 
	-- npc.Create(3,3,3269,7545)
	npc.SetPos(3,3269,7545)
	npc.SetAt(3,0,1)
	npc.SetAnim(3,101)
	npc_weapon(3,3)	
	--暮菖兰 
	-- npc.Create(4,4,3176,7482)
	npc.SetPos(4,3176,7482)
	npc.SetAt(4,0,1)
	npc.SetAnim(4,125)
	--皇甫卓 
	-- npc.Create(6,6,3287,7398)
	npc.SetPos(6,3287,7398)
	npc.SetAt(6,0,1)
	npc.SetAnim(6,125)
	--飞行石 
	npc.SetVisible(21,1)
	
	
	
	
	
	
	

	
	

	
	
	
	

	
	
	
	
	global.Wait(1.9)
	
	

	
	
	--镜头5  
	-- 依次扫过众人 
	camera.ResetLerp(0)	
	camera.ChangeCameraStatic(3236,-392,7680,3247,-437,7592)	
	camera.ResetLerp(5000)	
	camera.ChangeCameraStatic(3257,-444,7595,3278,-467,7500)			
	--音效 风声 
	global.PlaySoundLoop(2035,100)
	-- 短暂的震动  反复几次  	
	effect.FadeIn(1,0.5)
	global.Wait(2)
	camera.Shake(1,2)
	global.Wait(2)
	camera.Shake(1,2)
	global.WaitForCameraLerp()
	global.Wait(0.5)

	--对话 
	ui.Dialog(78611,138,2,3,0,0) 	--姜承 --快起来！
	
	camera.Shake(1,2)

	
	
	camera.ResetLerp(0)	
	camera.ChangeCameraStatic(3233,-453,7514,3245,-486,7420)	
	camera.ResetLerp(3500)	
	-- camera.ChangeCameraStatic(3224,-456,7554,3256,-481,7462)		
	camera.ChangeCameraStatic(3208,-459,7555,3256,-478,7469)

	-- 瑕爬起来 瑕抚头 
	--瑕站起来 
	npc.SetAnim(2,126)
	global.Wait(2.1)
	npc.SetAnim(2,247)	
	global.Wait(1)
	
	--对话 
	ui.Dialog(78612,505,0,2,0,0) 	--呃……天旋地转的……

	camera.Shake(1,2)	
	
	-- 瑕走到夏侯身边 
	npc.TurnToNpc(2,1,1)
	npc.SetAnim(2,243)
	global.Wait(1.5)
	global.PlaySoundLoop(1649,100)
	npc.RunTo(2,3267,7477,1)
	global.StopLastSound()
	npc.TurnTo(2,-1,1,1)
	-- 瑕蹲下  
	npc.SetAnim(2,219)
	global.Wait(2)
	--对话 
	ui.Dialog(78613,501,0,2,0,0) --担心 --乌鸦嘴，你还好吧？
	global.Wait(2)
	
	-- 瑕恢复站立  
	-- 夏侯爬起来  
	-- 夏侯濒死 
	npc.SetAnimSpeed(1,40)
	npc.SetAnim(1,126)
	
	camera.ResetLerp(5000)		
	camera.ChangeCameraStatic(3235,-460,7526,3279,-465,7436)
	
	global.Wait(2.5)
	camera.Shake(1,2)	
	npc.SetAnim(1,125)
	-- npc.SetHeadRotTo(2,1,0,50)
	npc.SetAnimSpeed(1,100)	
	global.Wait(0.5)
	
	--对话  
	ui.Dialog(78614,520,0,1,0,0) 		--还……还好……
	
	-- npc.SetHeadRot(2,0,0)
	-- npc.SetHeadRotTo(2,1,1,50)	
	npc.SetAnim(2,207,1)	
	npc.SetAnim(2,200)
	npc.SetHeadRotTo(2,1,0,100)
	global.Wait(1)
	
	ui.Dialog(78615,195,2,2,0,0) --松口气--唉，看你，摔成这样，还说我反应不及呢。
	
	npc.TurnToNpc(1,2,1)
	-- npc.SetAnim(2,200)
	-- npc.SetHeadRotTo(2,1,1,50)	
	camera.Shake(1,2)		
	
	ui.Dialog(78616,194,2,2,0,0) 	--还好还好，刚刚要不是暮姐姐和姜小哥机灵，拿剑捅这大怪虫嘴巴的话，咱们就都被吞下肚啦。



	
	--镜头6  
	-- 全镜 
	camera.ResetLerp(0)	
	camera.ChangeCameraStatic(3191,-398,7645,3222,-440,7559)	
	camera.ResetLerp(10000)	
	camera.ChangeCameraStatic(3189,-415,7657,3221,-443,7567)		
	--音效停 
	global.StopLastSound()
	-- 播放音乐 zd05
	global.PlayMusic(105,100,3000)			
	--动作 
	-- 暮菖兰、皇甫卓备战 
	npc.TurnTo(6,-1,-1,1)
	
	camera.Shake(1,2)			
	
	npc_weapon(4,4)	
	npc_weapon(6,6)	
	npc.SetAnim(6,101)
	npc.SetAnim(4,101)
	global.Wait(0.5)
	
	--对话 
	ui.Dialog(78617,179,0,4,0,0) 	--戒备 --妹子先别放松，地面震动的厉害，那怪虫不知什么时候还会窜出来。
	ui.Dialog(78618,556,2,6,0,0) 	--怒 	--这砂虫只会借地势乘人不备，有了方才的经验，它休想再能得手！
	
	-- 震动  较强烈 
	global.Wait(2)
	camera.Shake(7,5)		
	global.Wait(2)

	npc.TurnTo(3,-1,1,1)
	npc.SetAnim(3,101)
	npc_weapon(6,0)	
	npc.TurnTo(6,-1,1,1)
	npc_weapon(6,6)	
	npc.SetAnim(6,101)
	npc.TurnTo(1,-1,1)
	npc.SetHeadRot(2,0,0)
	npc.TurnTo(2,-1,1,1)
	-- npc.SetAnim(2,101)
	
	global.Wait(1)
	
	
	
	
	
	
	
	

	--镜头   
	camera.ResetLerp(0)	
	camera.ChangeCameraStatic(3323,-469,7358,3269,-470,7442)	
	camera.ResetLerp(3000)	
	camera.ChangeCameraStatic(3276,-462,7384,3234,-447,7474)

	

	npc_weapon(2,0)	
	npc_weapon(6,0)	
	npc.RunTo(6,3218,7497)
	npc.RunTo(2,3242,7522,1)
	npc_weapon(2,2)	
	npc.SetAnim(2,101,0,1)--
	global.WaitForNpcPos(6,3218,7497)
	npc_weapon(6,6)	
	npc.SetAnim(6,101,0,1)--
	npc_weapon(4,0)	
	npc.RunTo(4,3190,7496,1)
	npc.TurnToNpc(4,17,1)
	npc_weapon(4,4)	
	npc.SetAnim(4,101,0,1)--
	npc_weapon(3,0)	
	npc.RunTo(3,3248,7546,1)
	npc.TurnToNpc(3,17,1)
	npc_weapon(3,3)	
	npc.SetAnim(3,101,0,1)--
	npc.SetAnim(1,101,0,1)--
	
	

	
	--沙虫钻出 
	--沙冲钻出音效
	global.PlaySound(2019,100)		
	global.Wait(0.2)
	npc.SetVisible(16,1)	
	global.CreateSE(4810,3048,-499,7727)
	npc.SetAnim(16,311)
	global.Wait(1)
	--动态模糊
	effect.MotionBlur(1)
	global.Wait(3)
	effect.MotionBlur(0)	
	
	
	
	
	
	
	npc.SetPos3D(16,3090,-510,7700)
	npc.SetAnim(16,200)
	
	camera.ResetLerp(0)		
	camera.ChangeCameraStatic(3168,-454,7581,3229,-469,7503)

	--对话  
	ui.Dialog(78619,136,2,3,0,0) 	--紧张--夏侯兄，瑕姑娘，你们还支撑得住吗？
	ui.Dialog(78620,182,2,2,0,0) 	--没事，就摔了一下嘛，没什么大不了的。
	ui.Dialog(78621,519,0,1,0,0) 		--无奈--嗯，我也还好。
	ui.Dialog(78622,711,0,4,0,0) 	--这是准备享用我们这道大餐了啊。
	
	
	
	ui.Dialog(78623,552,0,6,0,0) 	--怒--来得正好！
	ui.Dialog(78624,552,0,6,0,0) 	--怒--孽畜，决不让你们再为祸人间！
	
	

	
	
	

	camera.ResetLerp(0)		
	camera.ChangeCameraStatic(3259,-468,7423,3212,-440,7506)
	camera.ResetLerp(8000)			
	camera.ChangeCameraStatic(3255,-481,7403,3217,-449,7490)	
	--沙虫攻击 
	effect.MotionBlur(1)		
	npc.SetAnim(16,300)
	global.Wait(1.5)
	--音效 沙虫咆哮 
	global.PlaySound(584,100)			
	global.WaitForNpcAnim(16,300)
	npc.SetAnimSpeed(16,20)
	npc.SetAnim(16,200)
	npc.SetAnimSpeed(16,100)	

	global.Wait(1)
	effect.MotionBlur(0)

	--变更队列 
	player.SetMainPlayer(p_id(6))

	player.LockPlace(p_id(1),0)
	player.LockPlace(p_id(2),0)
	player.LockPlace(p_id(3),0)
	player.LockPlace(p_id(4),0)

	player.LockPlace(p_id(6),1)--锁定皇甫卓

	--清理npc 
	for	i=1,10,1
		do
		npc_weapon(i,0)
		end	

	for	i=1,10,1
		do 
		npc.SetHeadRot(i,0,0)
		end
		
	-- func_end(0,0,1)		
	-- func_end(3248,7482,1,1)	
	player.Control(1)
	global.SetWideScreen(0)


	--开始战斗 
	--boss沙虫  
	battle.Begin(2012,409,1)
	

end



