--dlc1-1
--地点：夏侯府
--主旗标44001
--脚本id=24101
function dlc01_1()
	--开始剧情
	func_start(0,0,0)	
	--变更旗标
	flag.SetValue(44001,102)
	--记录当前地图
	flag.SetValue(42006,1) --播传送特效控制旗标
	flag.SetValue(42001,map.GetCurrentMapID())
	local pid=player.GetMainPlayer()
	local x1,y1,z1=player.GetPos(pid)
	flag.SetValue(42002,x1)
	flag.SetValue(42003,z1)
	local nXiaHou = 9501
	local nXia = 9502
	local nJiang = 9503
	local nLan = 9504
	local nGang = 9505
	local nHuang = 9506
	local nLong = 9507
	local nLing = 9508
	local nXue = 9509
	local nLuo = 9510
	local nBao = 15
	--黑屏
	effect.SetFilterTexture(10259,0)
  
	--预调明州、夏侯府，不调脚本
	map.ChangeNoScript(2,4001,1065)		
  
	--创建包子和夏侯
	npc.Create(91,15,1,1)
	npc.SetVisible(15,0)
	npc.Create(1,nXiaHou,2614,5882) --小少爷
	
	--开始音乐
	global.PlayMusic(172,70)
	wt(1)
	ui.Dialog(92075,520,0,nXiaHou,0,0)
	ui.Dialog(92076,520,0,nXiaHou,0,0)
    ui.Dialog(92077,0,0,nBao,0,0)
	ui.Dialog(92078,519,0,nXiaHou,0,0)
	ui.Dialog(92079,0,0,nBao,0,0)
	ui.Dialog(92080,524,0,nXiaHou,0,0)
	ui.Dialog(92081,0,0,nBao,0,0)
	ui.Dialog(92082,0,0,nBao,0,0)
	ui.Dialog(92083,523,0,nXiaHou,0,0)
	ui.Dialog(92084,0,0,nBao,0,0)
	
	--预调明州、夏侯府，不调脚本
	-- map.ChangeNoScript(2,4001,1065)		
	local mPosX = 2571
	local mPosZ = 5245
	local mTeleX = -20
	-- npc.Create(1,nXiaHou,2560,6765)
	npc.SetPos(9501,2560,6765)
	npc.SetAt(nXiaHou,0,1)
	npc.Create(2,nXia,2600+mTeleX,4897) --瑕
	npc.SetAtPos(nXia,mPosX,mPosZ)
	npc.Create(3,nJiang,2583+mTeleX,4867) --姜承
	npc.SetAtPos(nJiang,mPosX,mPosZ)
	npc.Create(4,nLan,2617+mTeleX,4883) --暮菖兰
	npc.SetAtPos(nLan,mPosX,mPosZ)
	npc.Create(5,nGang,2635+mTeleX,4887) --大叔
	npc.SetAtPos(nGang,mPosX,mPosZ)
	npc.Create(6,nHuang,2572+mTeleX,4820) --皇甫卓
	npc.SetAtPos(nHuang,mPosX,mPosZ)
	-- npc.Create(6,nHuang,2563,4868) --皇甫卓
	npc.Create(7,nLong,2686+mTeleX,4861) --龙溟
	npc.SetAtPos(nLong,mPosX,mPosZ)
	npc.Create(8,nLing,2677+mTeleX,4848) --凌波
	npc.SetAtPos(nLing,mPosX,mPosZ)
	npc.Create(9,nXue,2642+mTeleX,4779-10) --厉岩
	npc.Create(10,nLuo,2621+mTeleX,4793-10) --结萝
	npc.TurnToPos(nXue,2621+mTeleX,4793-10)
	npc.TurnToPos(nLuo,2642+mTeleX,4779-10)--厉岩结萝互看
	npc.SetHeadRot(nXue,0,15)
	npc.SetHeadRot(nLuo,0,-20)
	--结萝撒娇
	npc.SetAnim(nLuo,225,2)
	
	--###@@@
	camera.ResetLerp(0)
	camera.ChangeCameraStatic(2561,357,6787+8,2561,274,6730+8)
	--夏侯挡光
	npc.SetAnim(nXiaHou,220,2)
	wt(1)
	--取消黑屏
	effect.SetFilterTexture(0,0)
    --强光
	effect.FadeInWhite(1,0.25)
	wt(3)
	camera.ResetLerp(2000)
	camera.ChangeCameraStatic(2561,357,6787,2561,274,6730)
	wt(1)
	ui.Dialog(92085,531,2,nXiaHou,0,0)
	wt(1)
	camera.ResetLerp(6000)
	camera.ChangeCameraStatic(2526,328,6811,2591,325,6735)
	wt(1)
    --夏侯左右看
	head_lr(nXiaHou)
	wt(1)
	npc.TurnToPos(nXiaHou,2598,6544,1)
	wt(0.5)
	--夏侯左右看
	head_lr(nXiaHou)
	global.WaitForCameraLerp()
	wt(0.5)
	npc.MoveTo(nXiaHou,2598,6544)
	wt(0.5)
	camera.ResetLerp(4000)
	camera.ChangeCameraStatic(2526,328,6811,2574,325,6723)
	wt(1)
	effect.FadeOut(1,1)
	wt(1.5)
	npc.Stop(nXiaHou)
	--==========
	
	--###@@@镜头，夏侯走向池塘
	camera.ResetLerp(0)
	camera.ChangeCameraStatic(2513,327,5479,2513,321,5579)
	camera.ResetLerp(3000)
	camera.ChangeCameraStatic(2493,327,5479,2494,321,5579)
	-- npc.Create(91,nBao,1,1)
	npc.SetVisible(nBao,0)
	--调整夏侯位置
	npc.SetPos(nXiaHou,2564,5607)
	npc.MoveTo(nXiaHou,2494,5558)
	effect.FadeIn(1,1)
	wt(3)
    --瑕招呼
	ui.Dialog(92086,0,0,nBao,0,0) --咦？！你们看，那个是……乌鸦嘴！
	wt(0.5)
	--==========
	
	--###@@@镜头，直接切近
	camera.ResetLerp(0)
	camera.ChangeCameraStatic(2495,329,5537,2490,330,5637)
	npc.SetAnim(nXiaHou,225,2)
	wt(2)
	ui.Dialog(92087,519,0,nXiaHou,0,0) --怎么又是……乌鸦嘴啊……
	wt(0.3)
	ui.Dialog(92088,0,0,nBao,0,0) --喂——乌鸦嘴——我们在这里呢！
	npc.TurnToNpc(nXiaHou,nXia,1)
	--姜承思考
	npc.SetAnim(nJiang,216)
	wt(0.3)
	--==========
	
	--###@@@镜头
	camera.ResetLerp(0)
	camera.ChangeCameraStatic(2526,358,5027,2568,352,4937)
	camera.ResetLerp(6000)
	camera.ChangeCameraStatic(2553,355,4983,2595,349,4892)
	--调整动作
	npc.SetAnimSpeed(nXia,70)
	npc.SetAnimSpeed(nHuang,70)
	npc.SetAnimSpeed(nXue,70)
	npc.SetAnimSpeed(nLuo,70)
	npc.SetAnimSpeed(nLan,70)
	npc.SetAnimSpeed(nGang,70)
	--瑕挥手
	npc.SetAnim(nXia,212,2)
	wt(1)	
	--皇甫卓上前一步
	npc.MoveTo(nHuang,2551,4846)
	wt(0.5)
	--姜承看向夏侯
	npc.SetAnim(nJiang,200)
	--厉岩和结萝看过来
	npc.SetHeadRot(nLuo,0,0)
	npc.SetHeadRot(nXue,0,0)
	npc.TurnToPos(nXue,mPosX,mPosZ)
	npc.TurnToPos(nLuo,mPosX,mPosZ)
	wt(0.5)
	--兰姐笑
	npc.SetAnim(nLan,211,2)
	wt(0.5)
	--大叔
	npc.SetAnim(nGang,212,2)
	global.WaitForCameraLerp()
	--==========
	
	--###@@@镜头，夏侯
	camera.ResetLerp(0)
	camera.ChangeCameraStatic(2495,329,5537,2490,330,5637)
	wt(0.3)
	ui.Dialog(92089,523,0,nXiaHou,0,0) --啊……大家……
	wt(0.2)
	--瑕招手
	npc.SetAnim(nXia,212,2)
	wt(0.7)
	--==========
	
	--###@@@镜头，瑕
	camera.ResetLerp(0)
	camera.ChangeCameraStatic(2578,357,4933,2579,349,4834)
	camera.ResetLerp(2500)
	camera.ChangeCameraStatic(2578,356,4927,2578,354,4827)
	wt(1.5)
	effect.FadeOutWhite(1,1)
	wt(1)
	--==========
	
	--###@@@回忆
	--夏侯和瑕初遇镜头挪过来
	map.ChangeNoScript(1,1065)
	--临时用人物
	-- npc.Create(2,nXia,6364,4006)-- 瑕
	npc.Create(2,nXia,6174,3954)
	-- npc.Create(1,nXiaHou,6139,4060)--夏侯
	camera.ResetLerp(0)
	x=6075
	z=4028
	-- npc.SetPos(nXia,6174,3954)--瑕
	camera.ChangeCameraStaticToNpc(6079,339,4055,nXia)--6079,336,4030
	npc.RunTo(nXia,5956,4042)
	-- wt(0.8)
	wt(0.2)
	-- effect.FadeInWhite(1,1)
	--回忆模式
	effect.SetFilterTexture(7010,0)
	effect.SetFadeTarget(40)
	--瑕的特写镜头
	fade(10,100)
	-- npc.Stop(nXiaHou)
	effect.MotionBlur(1)--模糊
	global.SetMotionSpeed(20)--慢动作
	wt(3.5)
	--淡出
	effect.FadeOutWhite(1,1)
	wt(2.5)
	global.SetMotionSpeed(100)--恢复慢镜
	--剧情结束删除两人
	npc.Destroy(nXiaHou)
	npc.Destroy(nXia)
	wt(1)
	--回忆完毕
	--回到夏侯府
	map.Change(1,4001)
	effect.MotionBlur(0)--模糊关
	--关闭回忆模式
	effect.SetFilterTexture(0,0)
	--==========
	
	--###@@@镜头
	camera.ResetLerp(0)
	camera.ChangeCameraStatic(2505,317,5450,2507,325,5550)
	--重新种人
	npc.Create(1,nXiaHou,2494,5558)
	npc.SetAtPos(nXiaHou,2600+mTeleX,4897)
	effect.FadeInWhite(1,0.7)
	wt(1.5)
	ui.Dialog(92090,521,0,nXiaHou,0,0) --瑕姑娘……
	wt(0.5)
	npc.MoveTo(nXiaHou,2552,5291)
	wt(1.5)
	effect.FadeOut(1,1)
	wt(1.5)
	--==========
	
	--###@@@镜头，夏侯走近人群
	camera.ResetLerp(0)
	camera.ChangeCameraStatic(2553,358,4970,2608,336,4890)
	camera.ResetLerp(3000)
	camera.ChangeCameraStatic(2553,358,4970,2601,345,4883)
	--重新种人
	local mXiaHouX = 2609
	local mXiaHouZ = 4897
	npc.SetPos(nXiaHou,2609,4952)
	npc.SetAt(nXiaHou,0,-1)
	npc.Create(2,nXia,2586,4860) --瑕
	npc.SetAtPos(nXia,mXiaHouX,mXiaHouZ)
	npc.Create(3,nJiang,2573,4884) --姜承
	npc.SetAtPos(nJiang,mXiaHouX,mXiaHouZ)
	npc.Create(4,nLan,2602,4849) --暮菖兰
	npc.SetAtPos(nLan,mXiaHouX,mXiaHouZ)
	npc.Create(5,nGang,2627,4860) --大叔
	npc.SetAtPos(nGang,mXiaHouX,mXiaHouZ)
	npc.Create(6,nHuang,2561,4861) --皇甫卓
	npc.SetAtPos(nHuang,mXiaHouX,mXiaHouZ)
	npc.Create(7,nLong,2657,4881) --龙溟
	npc.SetAtPos(nLong,mXiaHouX,mXiaHouZ)
	npc.Create(8,nLing,2655,4863) --凌波
	npc.SetAtPos(nLing,mXiaHouX,mXiaHouZ)
	npc.Create(9,nXue,2630,4830) --厉岩
	npc.SetAtPos(nXue,mXiaHouX,mXiaHouZ)
	npc.Create(10,nLuo,2628,4811) --结萝
	npc.SetAtPos(nLuo,mXiaHouX,mXiaHouZ)
	wt(1)
	--淡入
	effect.FadeIn(1,1)
	npc.SetSpeed(nXiaHou,0.7)
	npc.SetAnimSpeed(nXiaHou,70)
	npc.MoveTo(nXiaHou,2609,4897)
	npc.SetAnim(nXia,211,2)
	global.WaitForCameraLerp()
	--==========
	
	--###@@@镜头，三人
	camera.ResetLerp(0)
	camera.ChangeCameraStatic(2582,351,4900,2623,351,4809)
	npc.TurnToNpc(nXia,nGang,1)
	npc.SetHeadRot(nLan,-50,0,0,40)
	-- npc.SetHeadRot(nGang,-35,0,0,40)
	npc.TurnToNpc(nGang,nXia)
	wt(0.2)
	ui.Dialog(92091,190,0,nXia,0,0) --嘻嘻，这样一来人不就齐了么！我说什么来着，大个儿～
	wt(0.4)
	npc.SetAnim(nGang,217,2)
	wt(0.3)
	ui.Dialog(92092,118,2,nGang,0,0) --还真是，有小姑娘的地方怎能少了小少爷，哈哈哈！
	wt(0.3)
    -- npc.TurnToNpc(nXia,nGang,1)
	npc.SetAnim(nXia,233,2)
	wt(0.3)
	ui.Dialog(92093,190,0,nXia,0,0) --有吃喝的地方也少不了你啊……
	npc.SetSpeed(nXiaHou,1)
	npc.SetAnimSpeed(nXiaHou,100)
	npc.SetAnim(nXiaHou,200)
	npc.SetHeadRot(nXiaHou,25,0,1,100)
	wt(0.2)
	--==========
	
	--###@@@镜头，夏侯
	camera.ResetLerp(0)
	camera.ChangeCameraStatic(2601,356,4865,2632,351,4959)
	--朝向夏侯
	npc.SetHeadRot(nLan,0,0)
	npc.SetHeadRot(nGang,0,0)
	npc.TurnToNpc(nXia,nXiaHou)
	npc.TurnToNpc(nGang,nXiaHou)
	wt(0.3)
	ui.Dialog(92094,521,0,nXiaHou,0,0) --呵呵……
	wt(0.3)
	npc.SetHeadRot(nXiaHou,0,0,1,50)
	npc.SetAnim(nXiaHou,217,2)
	wt(0.5)
	ui.Dialog(92095,522,0,nXiaHou,0,0) --对了，大家为何群聚在此？是你们将我召来此处？
	wt(0.3)
	--龙溟思考动作
	npc.SetAnim(nLong,216)
	--==========
	
	--###@@@镜头
	camera.ResetLerp(0)
	camera.ChangeCameraStatic(2611,358,4893,2525,349,4842)
	npc.MoveTo(nHuang,2571,4867,1)
	wt(0.3)
	ui.Dialog(92096,545,0,nHuang,0,0) --你也不知道缘由？
	wt(0.3)
	--==========
	
	--###@@@镜头，切回
	camera.ResetLerp(0)
	camera.ChangeCameraStatic(2601,356,4865,2632,351,4959)
	camera.ResetLerp(2500)
	camera.ChangeCameraStatic(2598,356,4865,2629,350,4960)
	npc.TurnToNpc(nXiaHou,nHuang,1)
	wt(0.2)
	npc.SetAnim(nXiaHou,207,2)
	wt(2)
	--==========
	
	--###@@@镜头，切回
	camera.ResetLerp(0)
	camera.ChangeCameraStatic(2611,358,4893,2525,349,4842)
	npc.SetAnimSpeed(nJiang,25)
	npc.SetAnim(nJiang,216)
	wt(0.5)
	npc.SetAnimSpeed(nJiang,100)
	npc.SetAnim(nJiang,216)
	ui.Dialog(92097,132,0,nJiang,0,0) --奇怪……
	--凌波思考动作
	npc.SetAnim(nLing,216)
	wt(0.4)
	--==========
	
	--###@@@镜头，龙波
	camera.ResetLerp(0)
	camera.ChangeCameraStatic(2619,355,4874,2719,354,4868)
	wt(0.5)
	--凌波对话
	npc.SetAnimSpeed(nLing,25)
	npc.SetAnim(nLing,200)
	wt(0.4)
	npc.SetAnimSpeed(nLing,100)
	npc.SetAnim(nLing,200)
	npc.TurnToNpc(nXiaHou,nLing)
    ui.Dialog(92098,150,0,nLing,0,0) --夏侯公子，你可记得是如何来到此地？
	--夏侯看凌波
	npc.TurnToNpc(nXiaHou,nLing,1)
	wt(0.3)
	ui.Dialog(92099,520,2,nXiaHou,0,0) --我也不是很清楚，只记得听见一个奇怪的声音，之后眼前白光一闪，便来到了此处。
	wt(0.3)
	ui.Dialog(92100,154,0,nLing,0,0) --嗯，与我们的情况大同小异……看来还是没有头绪……
	--罡斩摸头
	npc.SetVisible(nGang,0)
	npc.SetAnim(nGang,216)
	wt(0.3)
	--==========
	
	--###@@@镜头，三人
	camera.ResetLerp(0)
	-- camera.ChangeCameraStatic(2581,351,4904,2622,351,4813)
	camera.ChangeCameraStatic(2636,358,4894,2578,353,4812)
	npc.SetVisible(nGang,1)
	wt(0.6)
	ui.Dialog(92101,110,2,nGang,0,0) --这可太不妙啊……
	--兰和瑕和皇甫卓一起转头
	npc.TurnToNpc(nLan,nGang)
	npc.TurnToNpc(nXia,nGang)
	npc.TurnToNpc(nHuang,nGang)
	npc.SetAnim(nLan,217,2)
	wt(0.5)
	ui.Dialog(92102,162,0,nLan,0,0) --怎么说？
	wt(0.3)
	npc.TurnToNpc(nGang,nLan,1)
	ui.Dialog(92103,118,2,nGang,0,0) --我们被困在这么一个冰天雪地的地方，没酒喝可怎么办啊？
	--瑕无奈
	npc.SetAnim(nXia,207,2)
	wt(1)
	ui.Dialog(92104,500,0,nXia,0,0)	--又来了……
	wt(0.3)
	ui.Dialog(92105,709,0,nLan,0,0) --还真是三句话不离本行。
	--暮菖兰思索
	npc.SetAnimSpeed(nLan,25)
	npc.SetAnim(nLan,216)
	wt(0.5)
	npc.SetAnimSpeed(nLan,100)
	npc.SetAnim(nLan,216)
	ui.Dialog(92106,161,0,nLan,0,0)	--不过，没有食物，确实是个大麻烦。
	--皇甫看向罡斩那边
	-- npc.SetHeadRot(nHuang,30,0)
	wt(0.3)
	camera.ResetLerp(3000)
	camera.ChangeCameraStatic(2636,358,4894,2569,353,4819)
	wt(0.5)
	npc.SetAnimSpeed(nHuang,25)
	npc.SetAnim(nHuang,216)
	wt(0.5)
	npc.SetAnimSpeed(nHuang,100)
	npc.SetAnim(nHuang,216)
	wt(1)
	ui.Dialog(92107,550,0,nHuang,0,0) --究竟是何人将我们聚集在此，他的目的何在？
	npc.TurnToNpc(nLuo,nXue,1)
	wt(0.3)
	--==========
	
	--###@@@镜头
	camera.ResetLerp(0)
	camera.ChangeCameraStatic(2608,355,4849,2675,359,4774)
	npc.SetAnim(nLuo,225)
	wt(0.5)
	ui.Dialog(92108,561,0,nLuo,0,0) --嘻～反正是跟大哥在一起，管他呢～
	-- npc.SetHeadRot(nJiang,20,0)
	npc.TurnToNpc(nLuo,nLan,1)
	head_lr(nLuo)
	wt(0.5)
	npc.SetAnim(nLuo,210,2)
	wt(0.3)
	ui.Dialog(92109,560,0,nLuo,0,0) --不过……这么多闲人在这碍眼，真是讨厌！
	wt(0.3)
	ui.Dialog(92110,622,2,nXue,0,0) --……
	wt(0.3)
	npc.SetHeadRot(nXue,-25,0,1,40)
	wt(0.5)
	--==========
	
	--###@@@镜头
	camera.ResetLerp(0)
	camera.ChangeCameraStatic(2590,358,4872,2510,365,4932)
	wt(0.3)
	ui.Dialog(92111,622,0,nXue,0,0) --你怎么看？
	wt(0.3)
	npc.SetHeadRot(nJiang,20,0,1,50)
	ui.Dialog(92112,132,0,nJiang,0,0) --静观其变，小心为上。
	wt(0.3)
	--==========
	
	--###@@@镜头，龙波
	camera.ResetLerp(0)
	camera.ChangeCameraStatic(2619,355,4874,2719,354,4868)
	camera.ResetLerp(5000)
	camera.ChangeCameraStatic(2619,355,4876,2719,354,4871)
	wt(0.3)
	npc.SetAnimSpeed(nLong,25)
	npc.SetAnim(nLong,200)
	wt(0.5)
	npc.SetAnimSpeed(nLong,100)
	npc.SetAnim(nLong,200)
	ui.Dialog(92113,629,2,nLong,0,0) --不错。兵临险境，最忌慌乱。依我们的实力，步步为营，稳步推进，应无危险。
	wt(0.3)
	ui.Dialog(92114,182,0,nXia,0,0) --对，与其在这儿干着急，不如大家一起往前走走看。
	npc.TurnToNpc(nXiaHou,nXia,1)
	wt(0.2)
	--==========
	
	--###@@@镜头，夏侯
	camera.ResetLerp(0)
	camera.ChangeCameraStatic(2598,356,4865,2628,351,4961)
	wt(0.3)
	head_nod(nXiaHou)
	ui.Dialog(92115,521,0,nXiaHou,0,0) --嗯。
	wt(0.3)
	effect.FadeOut(1,0.7)
	wt(1.5)
	npc.Destroy(nXiaHou)
	npc.Destroy(nXia)
	npc.Destroy(nJiang)
	npc.Destroy(nLan)
	npc.Destroy(nGang)
	npc.Destroy(nHuang)
	npc.Destroy(nLong)
	npc.Destroy(nLing)
	npc.Destroy(nXue)
	npc.Destroy(nLuo)
	npc.Destroy(nBao)
	
	
	--保存当前队伍
		local fid=42011
		local pid
		for i=0,9,1 do
			pid=2^i
			if player.IsPlayerInTeam(pid)==1 then
				flag.SetValue(fid+i,1)
			else
				flag.SetValue(fid+i,0)
			end
		end
				
				
		--队伍只保留夏侯
		if player.IsPlayerInTeam(1)==0 then
			player.Add(1,0,1)
		end
		local pid
		for i=1,9,1 do
			pid=2^i
			if player.IsPlayerInTeam(pid)==1 then
				player.Remove(pid)
			end
		end
	
	camera.ResetLerp(0)
	camera.ChangeCameraStatic(2610,422,4662,2609,391,4757)
	player.SetAt(0,1)
    --剧情结束	
	func_end(2609,4876,1,0.7)
end