--绝行天途
function m045_1()

func_start(0,0,0)

--预载地图，人界山洞，魔教大殿，猿啼峰，蜀山，丹房，夏侯家，开封，折剑，九黎祠，晴碧坡，萍山

--赋值
local nxh = 1
local nxia = 2
local nlan = 4
local nxs = 11
local nqs = 12
local nys = 13
local ndy = 14
local noyq = 15
local nly = 16
local ntb = 17
local ncg = 18
local ntf = 19
local nhfz = 20
local nxgl = 21
local noyy = 22
local noyfr = 23
local nmy = 24
local nlongy = 25
local nmth = 26
local nxh = 27
local nlan = 28

effect.FadeOut(1,100)
camera.ResetLerp(0)
camera.ChangeCameraStatic(1647,891,3842,1641,794,3863)
--干掉音乐 
global.PlayMusic(-1,0)

--结局cg
global.PlayCg(9)
global.WaitForCgEnd()
effect.FadeOut(1,100)

global.PlayCg(101)
global.WaitForCgEnd()
global.Wait(2)
--effect.SetFilterTexture(0,0)
--global.SetWideScreen(0)
--camera.Resume()
--global.EndScene(51)

--player.Control(1)



--魔教覆灭
map.ChangeNoScript(5,65,44,7,29,104)

--###########
--#人界山洞 #
--###########
player.SetPos(752,3203)

global.PlayMusic(162,100,5000)

--血手
npc.Create(36,11,886,3492)
npc.SetAtPos(11,856,3541)
npc.SetAnim(11,222)
--青石
npc.Create(24,12,1065,3210)
npc.SetVisible(12,0)
--玉书
npc.Create(23,13,1100,3254)
npc.SetVisible(13,0)
--神农鼎
npc.Create(377,31,856,3541)
npc.SetAtPos(31,886,3492)
npc.SetVisible(31,0)
--紫烟
npc.Create(76,32,612,-250,3790)
npc.Create(76,33,612,-200,3790)
npc.Create(77,34,686,-200,3793)

global.Wait(2)
ui.Dialog(85299,0,5,0,0,0)--枯木死后数月，净天教遭蜀山与四大世家围攻，姜世离被蜀山以三神器封印，血手趁众人不备，夺走神农鼎。
global.Wait(1)
camera.ResetLerp(0)
camera.ChangeCameraStatic(778,-271,3565,860,-311,3525)
camera.ResetLerp(10000)
camera.ChangeCameraStatic(783,-275,3555,865,-315,3514)
effect.FadeIn(1,0.5)
global.Wait(5)
camera.ResetLerp(0)
camera.ChangeCameraStatic(829,-316,3550,900,-328,3480)
--脚步声
global.PlaySoundLoop(2076,70)
global.Wait(0.5)
npc.SetHeadRot(nxs,20,-10,0,90)
global.Wait(2)
ui.Dialog(85300,0,0,nxs,0,0)--哼，偶然发现这充满魔气的山洞，想在此稍做休息，没想到蜀山的牛鼻子竟敢追进来。
--青石玉书现身
camera.ChangeCameraStatic(983,-271,3140,986,-293,3237)
camera.ResetLerp(5000)
camera.ChangeCameraStatic(1004,-272,3146,1007,-294,3244)
npc.SetVisible(12,1)
npc.SetVisible(13,1)
npc.SetSpeed(12,1.3)
npc.SetAnimSpeed(12,130)
npc.SetSpeed(13,1.3)
npc.SetAnimSpeed(13,130)
npc.MoveTo(nqs,985,3291)
npc.MoveTo(nys,1028,3329)
global.WaitForNpcPos(nqs,985,3291)
--脚步声停
global.StopLastSound()
npc.SetSpeed(12,1)
npc.SetAnimSpeed(12,100)
npc.TurnToNpc(nqs,nxs)
camera.ResetLerp(0)
camera.ChangeCameraStatic(925,-322,3319,1021,-319,3291)
global.WaitForNpcPos(nys,1028,3329)
npc.SetSpeed(13,1)
npc.SetAnimSpeed(13,100)
npc.TurnToNpc(nys,nxs,1)
npc.SetHeadRot(nys,0,10,0,90)
npc.SetHeadRot(nqs,0,10,0,90)
ui.Dialog(85301,0,0,nys,0,0)--血手，你想以神农鼎交换魔君，实在异想天开。如今你已无退路，交还神农鼎，束手就擒吧。
camera.ChangeCameraStatic(791,-274,3560,864,-309,3501)
global.Wait(1)
ui.Dialog(85302,0,0,nxs,0,0)--呵……休想！
npc.SetHeadRot(nxs,0,0,0,90)
--神农鼎出现
camera.ResetLerp(5000)
camera.ChangeCameraStatic(730,-252,3496,817,-299,3503)
npc.SetAppear(31,1)
global.Wait(1)
--爆炸特效
npc.CreateSE(nxs,2817)
global.PlaySound(1470,80)--身上特效声
global.Wait(2)
npc.CreateSE(nxs,2819)
global.PlaySound(1427,80)--小爆炸声
--开关慢镜头与动态模糊
global.SetMotionSpeed(35)
effect.MotionBlur(1)
npc.SetSpeed(31,5)
camera.ResetLerp(0)
camera.ChangeCameraStaticToNpc(730,-252,3496,31)
npc.FloatTo(31,686,-200,3793)
npc.CreateSE(31,930)
global.PlaySound(1447,80)--飞起声
global.Wait(0.3)
npc.CreateFloat(75,35,686,-200,3793)
global.Wait(0.7)
--空间扭曲
camera.ChangeCameraStatic(677,-113,3897,688,-167,3813)
global.SetMotionSpeed(100)
npc.SetSpeed(31,6)
npc.SetPos(31,856,3541)
npc.FloatTo(31,686,-200,3793)
npc.SetHeadRot(nys,0,-20,0,100)
npc.SetHeadRot(nqs,0,-20,0,100)
npc.CreateSE(31,930)
global.Wait(0.5)
--画面震动
camera.Shake(3,5)
global.PlaySound(1485,80)--大爆炸声
npc.SetSEVisible(31,1)
npc.SetAppear(31,0)
effect.FadeOut(1,2)
global.Wait(3)
--神农鼎隐藏
npc.SetVisible(31,0)
effect.MotionBlur(0)
effect.FadeIn(1,1)
camera.ChangeCameraStatic(991,-321,3206,977,-314,3305)
global.Wait(2)
--空间扭曲消失
npc.SetAppear(35,0)
npc.SetAppearTime(35,3)
global.Wait(1)
ui.Dialog(85303,0,0,nqs,0,0)--！！
npc.SetHeadRot(nqs,0,0,0,70)
global.Wait(1)
ui.Dialog(85304,0,0,nqs,0,0)--此处魔气深重，怕是洞穴深处存有连接魔界的缝隙，当速战速决。
npc.SetHeadRot(nqs,0,0,0,70)
ui.Dialog(85305,0,0,nys,0,0)--嗯，姜世离攻打锁妖塔虽未能破除两界封印，但攻击的震荡却使得两界间产生了些许不稳定的裂隙。
--global.MusicFadeIn(4000,75,100)--音乐拔高
npc.SetHeadRot(nys,0,10,0,90)
camera.ChangeCameraStatic(919,-287,3400,892,-323,3489)
camera.ResetLerp(5000)
camera.ChangeCameraStatic(919,-287,3400,892,-303,3489)
global.Wait(2)
npc.TurnToPos(nxs,1000,3321,1)
global.Wait(1)
camera.ResetLerp(0)
camera.ChangeCameraStatic(818,-312,3530,895,-318,3467)
ui.Dialog(85306,0,0,nxs,0,0)--区区女娲石，绝困不住主上，我净天教来日必当东山再起，再攻锁妖塔！今日，我便先要了你们的性命，为教中兄弟报仇！
camera.ResetLerp(500)
camera.ChangeCameraStatic(829,-312,3520,906,-318,3457)
effect.FadeOut(1,2)
--清除所有特效
global.ClearSE()
global.Wait(1.5)
global.PlaySound(4021,100)--刀剑声
global.PlayMusic(-1,0)--干掉音乐
global.Wait(3.5)

--###########
--#魔教大殿 #
--###########
map.ChangeNoScript(1,44)
player.SetPos(2608,2136)

--毒影
npc.Create(35,14,2602,1886)
--蜀山弟子
--1
npc.Create(3802,32,2622,3337)
--2
npc.Create(268,33,2726,3246)
npc.SetAtPos(33,2538,2975)
--3&4
npc.Create(262,34,2508,3014)
npc.SetAtPos(34,2538,2975)
npc.Create(367,35,2538,2975)
npc.SetAtPos(35,2508,3014)
--5
npc.Create(3804,36,2887,2626)
--6
npc.Create(3802,37,2521,2542)
npc.SetAtPos(37,2561,3572)
--7
npc.Create(3803,38,2664,2673)

ui.Dialog(85307,0,5,0,0,0)--毒影护送欧阳倩从密道逃离覆天顶，之后返回净天教总坛，只见满目苍夷。
global.Wait(1)
--有情燕
global.PlayMusic(152,100,8000)
--弟子开始走动
npc.MoveTo(32,2622,2448)
npc.MoveTo(36,2272,2626)
camera.ResetLerp(0)
camera.ChangeCameraStatic(2630,319,2523,2630,298,2621)
camera.ResetLerp(12000)
camera.ChangeCameraStatic(2633,318,2088,2633,285,2182)
effect.FadeIn(1,0.7)
global.Wait(4)
npc.TurnToNpc(38,37,1)
global.Wait(1)
npc.TurnToNpc(37,38,1)
global.Wait(4)
effect.FadeOut(1,1)
global.Wait(2)
camera.ResetLerp(0)
camera.ChangeCameraStatic(2528,288,1985,2591,263,1911)
effect.FadeIn(1,1)
global.Wait(1)
ui.Dialog(85308,0,0,ndy,0,0)--（大哥和主上？！……）
camera.ResetLerp(12000)
camera.ChangeCameraStatic(2541,282,1969,2602,255,1895)
global.Wait(2)
ui.Dialog(85309,0,0,ndy,0,0)--（……不，大哥一定不会有事……）
global.Wait(2)
ui.Dialog(85310,0,0,ndy,0,0)--我一定……会找到你！
global.Wait(1)
camera.ResetLerp(0)
camera.ChangeCameraStatic(2545,309,1914,2619,251,1881)
global.Wait(1)
camera.ResetLerp(6000)
camera.ChangeCameraStatic(2545,309,1914,2619,235,1879)
npc.MoveTo(ndy,2694,1859)
global.Wait(1)
npc.SetAppear(ndy,0,1)
global.Wait(1)
npc.Destroy(ndy)
effect.FadeOut(1,1)
global.Wait(2)
npc.SetAppearTime(ndy,3)

--###########
--#猿啼峰   #
--###########
map.ChangeNoScript(1,7)
player.SetPos(2789,1826)

--欧阳倩
npc.Create(60,15,2661,2049)
npc.SetAtPos(15,2652,2028)
npc.SetHeadRot(noyq,0,10,0,30)

ui.Dialog(85311,0,5,0,0,0)--欧阳倩隐居苍木山，世人所不知的是，她腹中已怀有魔君姜世离之子。
global.Wait(1)
camera.ResetLerp(0)
camera.ChangeCameraStatic(2710,4065,1907,2682,4015,1989)
camera.ResetLerp(35000)
camera.ChangeCameraStatic(2601,3992,1947,2653,3995,2032)
effect.FadeIn(1,0.5)
global.Wait(4)
ui.Dialog(85312,0,3,noyq,0,0)--云淡天清拂风暖，凡尘俗埃本无牵。\n世间多少痴情苦，离聚无悔……尽是缘。
global.Wait(2)
npc.SetHeadRot(noyq,0,0,0,30)
npc.SetSpeed(15,0.5)
npc.SetAnimSpeed(15,50)
npc.TurnToPos(noyq,2664,2099,1)
npc.SetSpeed(15,1)
npc.SetAnimSpeed(15,100)
npc.SetHeadRot(noyq,0,-25,1,20)
global.Wait(2)
ui.Dialog(85313,0,0,noyq,0,0)--世离……我们的孩子，就叫云凡可好？望他一生无忧，平凡安乐。
effect.FadeOut(1,0.3)
global.Wait(5)

--###########
--#蜀山     #
--###########
map.ChangeNoScript(1,29)
player.SetPos(2095,2130)

--凌音
npc.Create(62,16,2206,2261)
npc.SetAtPos(16,1983,2471)
--铁笔
npc.Create(61,17,2306,2167)
npc.SetAtPos(17,2206,2261)

ui.Dialog(85314,0,5,0,0,0)--覆天顶一役后，蜀山掌门一贫自责未曾及早应对魔教之乱，引咎卸职，由太武接任。
ui.Dialog(85315,0,5,0,0,0)--蜀山并建造七宫，立七圣——太武、一贫、青石、玉书、草谷、铁笔、凌音——镇守七宫，以加固两界封印。
ui.Dialog(85316,0,5,0,0,0)--蜀山七圣地位超然，皆以师兄妹互称。
global.Wait(1)
camera.ResetLerp(0)
camera.ChangeCameraStatic(2229,3330,2143,2216,3309,2240)
camera.ResetLerp(15000)
camera.ChangeCameraStatic(2198,3317,2167,2208,3304,2265)
effect.FadeIn(1,0.5)
global.Wait(7)
ui.Dialog(85317,0,0,nly,0,0)--……
global.Wait(1)
ui.Dialog(85318,0,0,ntb,0,0)--师妹。
npc.TurnToNpc(nly,ntb,1)
-- 点头
camera.ResetLerp(0)
camera.ChangeCameraStatic(2064,3335,2217,2162,3313,2222)
global.Wait(2)
npc.SetHeadRot(nly,0,20,1,40)
global.Wait(0.2)
npc.SetHeadRot(nly,0,0,1,50)
global.Wait(1)
npc.MoveTo(nly,2306,2167)
global.Wait(0.3)
npc.MoveTo(ntb,2486,2274)
global.Wait(1)
camera.ChangeCameraStatic(2337,3319,2045,2313,3310,2141)
camera.ResetLerp(5000)
camera.ChangeCameraStatic(2337,3319,2045,2313,3300,2141)
global.WaitForNpcPos(nly,2306,2167)
npc.SetHeadRot(nly,0,20,1,60)
global.Wait(1)
npc.SetHeadRot(nly,0,0,0,100)
--挪铁笔
npc.SetPos(ntb,2438,2234)
npc.TurnToPos(nly,2487,2283)
npc.MoveTo(ntb,2487,2283,1)
ui.Dialog(85319,0,0,nly,0,0)--师兄，罡斩师伯之事……
camera.ResetLerp(0)
camera.ChangeCameraStatic(2581,3323,2269,2482,3310,2270)
ui.Dialog(85320,0,0,ntb,0,0)--……
camera.ResetLerp(20000)
camera.ChangeCameraStatic(2564,3318,2302,2469,3306,2273)
npc.SetAnim(17,219,2)
global.Wait(2)
ui.Dialog(85321,0,0,ntb,0,0)--我都忘了，哈哈哈，那家伙肯定也不希望我们老惦记着他，而过得不快活。
npc.TurnToNpc(ntb,nly,1)
ui.Dialog(85322,0,0,ntb,0,0)--……你也是，别把自己压得太辛苦啦。
global.Wait(1)
npc.MoveTo(ntb,3015,2885)
global.Wait(3)
camera.ResetLerp(0)
camera.ChangeCameraStatic(2257,3317,2069,2315,3313,2150)
global.Wait(1)
npc.SetHeadRot(nly,0,20,1,60)
global.Wait(1)
camera.ResetLerp(8000)
camera.ChangeCameraStatic(2257,3317,2069,2328,3344,2133)
npc.SetHeadRot(nly,0,0,1,90)
npc.MoveTo(nly,2438,2234,1)
npc.MoveTo(nly,2719,2552)
effect.FadeOut(1,0.5)
global.Wait(5)

--###########
--#丹房     #
--###########
map.ChangeNoScript(1,104)
player.SetPos(4620,2370)

--草谷
npc.Create(59,18,4474,2357)
npc.SetAtPos(18,4431,2401)
npc.SetHeadRot(18,0,-20,0,100)
--唐风
npc.Create(58,19,4431,2401)
npc.SetAtPos(19,4474,2357)
npc.AddRefItem(19,97,6511)
npc.SetAnim(19,219)
npc.SetHeadRot(19,0,10,0,100)

ui.Dialog(85323,0,5,0,0,0)--大战期间，唐风及妻儿被囚于净天教地牢，唐妻身亡，幼女濒死，幸得蜀山以血玉相救。
global.Wait(1)
camera.ResetLerp(0)
camera.ChangeCameraStatic(4542,42,2375,4443,28,2372)
camera.ResetLerp(12000)
camera.ChangeCameraStatic(4542,42,2375,4443,26,2384)
effect.FadeIn(1,0.7)
global.Wait(2)
ui.Dialog(85324,0,0,ncg,0,0)--血玉已与令爱身合，她暂无大碍，只是身体会比寻常孩童虚弱，要好生调养。待得二十年后，需再行续命之术。
ui.Dialog(85325,0,0,ntf,0,0)--多谢道长！
npc.SetSpeed(18,0.7)
npc.SetAnimSpeed(18,70)
npc.MoveTo(ncg,4454,2377,1)
global.Wait(1)
ui.Dialog(85326,0,0,ncg,0,0)--真是可爱的孩子。可已有名字？
camera.ResetLerp(0)
camera.ChangeCameraStatic(4473,54,2400,4382,14,2408)
global.Wait(2)
ui.Dialog(85327,0,0,ntf,0,0)--……雨柔。
camera.ResetLerp(6000)
camera.ChangeCameraStatic(4448,47,2400,4367,-12,2403)
global.Wait(2)
ui.Dialog(85328,0,0,ntf,0,0)--小女初生之时，倩夫人以一支玉笛作为贺礼，笛上刻有“雨色轻风意，柔情怜花殇”两句，内人十分喜欢，便为小女取名为雨柔。
global.WaitForCameraLerp()
global.Wait(2)
effect.FadeOut(1,0.5)
global.Wait(5)

--武林
map.ChangeNoScript(4,1066,34,103,62)--夏侯家，皇甫家，欧阳家，魔界

--###########
--#夏侯     #
--###########
map.ChangeNoScript(1,1066)
player.SetPos(2562,6193)

--夏侯跟班 
npc.Create(101,39,2820,2127)
--守门弟子 
npc.Create(127,40,2550,6560)
npc.SetAt(40,0,1)
npc.Create(127,41,2670,6560)
npc.SetAt(41,0,1)

ui.Dialog(85329,0,5,0,0,0)--魔教之乱中，夏侯家两位门主相继过世，少主失踪，一时群龙无首。之后虽由一名远房子弟接任门主之位，但已挽不回倾颓之势。
ui.Dialog(85330,0,5,0,0,0)--数年之后，江湖上虽仍有四大世家之名，却已少见夏侯家的身影。
global.Wait(1)
camera.ResetLerp(0)
camera.ChangeCameraStatic(2581,402,7204,2583,405,7104)
camera.ResetLerp(10000)
camera.ChangeCameraStatic(2605,420,6926,2605,427,6826)
effect.FadeIn(1,1)
global.Wait(5)
npc.TurnToNpc(40,41,1)
global.Wait(0.5)
npc.TurnToNpc(41,40,1)
global.Wait(2)
camera.ResetLerp(8000)
camera.ChangeCameraStatic(2604,411,6867,2603,392,6769)
global.Wait(1)
npc.SetHeadRot(41,30,0,1,70)
global.Wait(0.2)
npc.SetHeadRot(41,-30,0,1,70)
global.Wait(0.2)
npc.SetHeadRot(41,0,0,1,70)
global.Wait(2)
global.WaitForCameraLerp() 
npc.SetHeadRot(40,20,-20,1,90)
global.Wait(1)
npc.SetHeadRot(41,-20,-20,1,80)
global.Wait(2)
camera.ResetLerp(0)
camera.ChangeCameraStatic(2322,482,2341,2406,455,2294)
camera.ResetLerp(8000)
camera.ChangeCameraStatic(2322,482,2341,2386,457,2269)
effect.FadeIn(1,1)
npc.MoveTo(39,2730,2055,1)
npc.MoveTo(39,2590,2061,1)
global.Wait(1)
npc.TurnToPos(39,2637,1989,1)
global.Wait(1)
camera.ChangeCameraStatic(2551,403,2168,2577,402,2072)
global.Wait(2)
camera.ResetLerp(12000)
camera.ChangeCameraStatic(2505,401,2195,2552,408,2107)
global.Wait(1)
ui.Dialog(85331,0,0,39,0,0)--少主……
global.Wait(2)
effect.FadeOut(1,0.5)
global.Wait(5)

--###########
--#皇甫     #
--###########
map.ChangeNoScript(1,34)
player.SetPos(2927,1888)

--皇甫
npc.Create(64,20,3449,2155)
npc.SetAtPos(20,3500,2155)
--夏孤临
npc.Create(224,21,3414,2181)
npc.SetAtPos(21,3500,2181)
--弟子
npc.Create(257,42,3515,2162)
npc.SetAt(42,-1,0)
--皇甫门卫左
npc.Create(211,43,3765,2192)
npc.SetAt(43,1,0)
--皇甫门卫右
npc.Create(211,44,3765,2118)
npc.SetAt(44,1,0)

ui.Dialog(85332,0,5,0,0,0)--皇甫卓继承了皇甫世家门主之位，行事作风却与乃父截然不同，江湖声望日隆，更与欧阳英成为忘年之交。
global.Wait(1)
camera.ResetLerp(0)
camera.ChangeCameraStatic(3975,150,2149,3881,117,2150)
camera.ResetLerp(10000)
camera.ChangeCameraStatic(3698,59,2151,3599,45,2145)
effect.FadeIn(1,0.7)
--npc.MoveTo(nxgl,3414,2181)
--npc.MoveTo(nhfz,3449,2155,1)
global.Wait(6)
camera.ResetLerp(0)
camera.ChangeCameraStatic(3298,63,1976,3361,61,2053)
camera.ResetLerp(15000)
camera.ChangeCameraStatic(3298,63,1976,3360,67,2054)
ui.Dialog(85333,0,0,42,0,0)--门主，前去品剑大会的事宜都已准备完全。
npc.SetHeadRot(nhfz,0,20,1,40)
global.Wait(0.2)
npc.SetHeadRot(nhfz,0,0,1,50)
global.Wait(0.5)
ui.Dialog(85334,0,0,nhfz,0,0)--好。
npc.SetHeadRot(nhfz,-20,0,1,80)
ui.Dialog(85335,0,0,nhfz,0,0)--走吧。
npc.SetHeadRot(nxgl,-20,0,0,80)
global.Wait(1)
ui.Dialog(85336,0,0,nxgl,0,0)--是。
camera.ResetLerp(6000)
camera.ChangeCameraStatic(3298,63,1976,3357,96,2050)
npc.SetHeadRot(nhfz,0,0,1,80)
global.Wait(0.5)
npc.SetHeadRot(nxgl,0,0,0,80)
global.Wait(0.5)
npc.MoveTo(42,3515,2100,1)
npc.TurnToPos(42,3515,2162)
npc.MoveTo(nxgl,3153+461,2181)
npc.MoveTo(nhfz,3449+200,2155)
global.Wait(3)
effect.FadeOut(1,0.5)
global.Wait(5)

--###########
--#欧阳     #
--###########
map.ChangeNoScript(1,103)
player.SetPos(1700,814)

--欧阳英 
npc.Create(19,22,1562,709)
npc.SetAt(22,0,-1)
--欧阳夫人 
npc.Create(20,23,1562,825)
npc.SetAt(23,0,-1)
npc.SetVisible(23,0)

ui.Dialog(85337,0,5,0,0,0)--因夏侯家日渐式微，上官家远在边陲，欧阳家既得皇甫家支持，稳立于武林。
global.Wait(1)
camera.ResetLerp(0)
camera.ChangeCameraStatic(1593,37,767,1552,55,677)
camera.ResetLerp(6000)
camera.ChangeCameraStatic(1593,37,767,1537,42,684)
effect.FadeIn(1,1)
global.WaitForCameraLerp()
global.Wait(2)
camera.ChangeCameraStatic(1680,73,845,1597,41,801)
npc.SetAppear(noyfr,1)
global.Wait(1)
npc.MoveTo(noyfr,1562,771,1)
camera.ChangeCameraStatic(1625,61,827,1567,36,749)
ui.Dialog(85338,0,0,noyfr,0,0)--老爷，该休息了。
global.Wait(0.5)
npc.TurnToNpc(noyy,noyfr,1)
ui.Dialog(85339,0,0,noyy,0,0)--嗯。慧儿呢？
global.Wait(1.5)
npc.SetAnimSpeed(noyfr,60)
npc.SetAnim(noyfr,221,2)
global.Wait(2)
ui.Dialog(85340,0,0,noyfr,0,0)--还在练剑。
global.Wait(2)
ui.Dialog(85341,0,0,noyy,0,0)--……欧阳世家的重担，今后，就要压在她身上了。
camera.ResetLerp(8000)
camera.ChangeCameraStatic(1654,74,866,1596,49,789)
global.Wait(2)
effect.FadeOut(1,0.5)
global.Wait(5)

--###########
--#魔界     #
--###########
map.ChangeNoScript(1,62)
player.SetPos(2631,2604)

--魔翳 
npc.Create(34,24,2659,2919)
npc.SetAt(24,0,-1)
npc.SetHeadRot(24,0,20,0,100)
--神农鼎
npc.Create(377,31,2659,2849)
--蚩尤坛守卫（建这名字的空npc） 
npc.Create(63,45,2659,2849) 
npc.SetVisible(45,0)
--龙幽
npc.Create(73,25,2659,3446)
npc.SetAt(25,0,-1)
npc.SetVisible(25,0)

camera.ResetLerp(0)
camera.ChangeCameraStatic(2389,678,3335,2442,652,3254)
camera.ResetLerp(8000)
camera.ChangeCameraStatic(2933,544,3191,2865,534,3118)
effect.FadeIn(1,1)
global.WaitForCameraLerp()
global.Wait(1)
camera.ChangeCameraStatic(2737,539,2985,2677,501,2914)
global.Wait(0.5)
ui.Dialog(85342,0,0,nmy,0,0)--虽是阴差阳错得到神农鼎，但若无水灵珠与女娲后人，也不过是废物。
global.Wait(2)
ui.Dialog(85343,0,0,nmy,0,0)--咳咳……
npc.SetAnim(24,223,2)
global.Wait(1)
ui.Dialog(85344,0,0,nmy,0,0)--罡斩那一击，竟伤我至此，恐需百年才能恢复，其间无法再施行缚魂术……
global.Wait(2)
ui.Dialog(85345,0,0,nmy,0,0)--龙溟已死，能穿越神魔之井前往人界的，只有……
ui.Dialog(85346,0,0,45,0,0)--长老大人，龙幽殿下驾到。
npc.TurnToNpc(nmy,nlongy)
camera.ChangeCameraStatic(2686,462,3473,2642,467,3384)
npc.SetHeadRot(24,0,0,0,100)
npc.SetVisible(25,1)
global.Wait(1)
npc.SetAnimSpeed(nlongy,85)
npc.SetSpeed(nlongy,0.85)
npc.MoveTo(nlongy,2649,2850)
global.Wait(2)
camera.ChangeCameraStatic(3077,708,3250,2990,661,3237)
camera.ResetLerp(4000)
camera.ChangeCameraStatic(3085,708,3197,2998,661,3185)
global.Wait(2)
camera.ResetLerp(0)
camera.ChangeCameraStatic(2717,482,3001,2658,510,2925)
camera.ResetLerp(2000)
camera.ChangeCameraStatic(2702,488,2982,2643,516,2906)
npc.SetAnim(24,219,2)
effect.FadeOut(1,1)
global.Wait(5)


--兰
map.ChangeNoScript(3,1086,1068,1099)--绿村，萍山，黑屏
--###########
--#暮霭村   #
--###########
map.ChangeNoScript(1,1086)
player.SetPos(9162,2930)

--暮大哥
npc.Create(74,26,8573,3244)
npc.SetAtPos(26,8599,3289)
--小黑
npc.Create(48,27,8486,3337)


camera.ResetLerp(0)
camera.ChangeCameraStatic(9565,165,3728,9552,109,3646)
effect.FadeIn(1,0.3)
global.Wait(3)
camera.ResetLerp(8000)
camera.ChangeCameraStatic(9565,165,3728,9484,169,3669)
global.WaitForCameraLerp()
global.Wait(1)
camera.ChangeCameraStatic(8484,79,3196,8572,75,3243)
camera.ResetLerp(10000)
camera.ChangeCameraStatic(8510,78,3175,8578,75,3248)
--隐小黑
npc.SetVisible(nxh,0)
global.Wait(4)
ui.Dialog(85347,0,0,nmth,0,0)--……转眼又是一年了啊。
global.Wait(2)
camera.ResetLerp(0)
camera.ChangeCameraStatic(8267,101,3172,8360,98,3210)
--现小黑
npc.SetVisible(nxh,1) 
ui.Dialog(85348,0,0,nxh,0,0)--小兰，去哪了？
npc.TurnToNpc(nmth,nxh,1)
ui.Dialog(85349,0,0,nmth,0,0)--小兰去看她的朋友了，你也见过的，她最要好的朋友。
camera.ResetLerp(8000)
camera.ChangeCameraStatic(8267,101,3172,8348,165,3225)
global.Wait(3)
effect.FadeOut(1,1)
global.Wait(5)

--###########
--#萍山     #
--###########
map.ChangeNoScript(1,1068)
player.SetPos(2437,4682)

--兰
npc.Create(4,28,2437,4682)
----碎祭坛
--npc.CreateFloat(69,34,2304,2398,4673) 
--npc.SetCollisionType(34,2) 
--碎鼎 

camera.ResetLerp(0)
camera.ChangeCameraStatic(3757,2546,3516,3736,2621,3454)
effect.FadeIn(1,0.3)
global.Wait(5)
camera.ResetLerp(8000)
camera.ChangeCameraStatic(3757,2546,3516,3736,2550,3454)
global.Wait(7.5)
camera.ResetLerp(13000)
camera.ChangeCameraStatic(4100,2644,3973,4014,2645,4024)
global.Wait(12.5)
camera.ResetLerp(15000)
--camera.ChangeCameraStatic(3579,2639,4655,3482,2617,4648)
camera.ChangeCameraStatic(3394,2597,4641,3298,2570,4641)
global.Wait(3)
npc.MoveTo(nlan,3266,4692)
global.Wait(8.5)
effect.FadeOut(1,0.3)
global.Wait(5)

player.SetPos(2955,4682)

--鸟叫声
global.PlaySound(4101,90)

--近景挪兰
camera.ResetLerp(0)
camera.ChangeCameraStaticToNpc(2757,2428,4812,nlan)
npc.SetPos(nlan,2955,4682)
effect.FadeIn(1,0.5)
npc.SetSpeed(nlan,0.8)
npc.SetAnimSpeed(nlan,80)
npc.MoveTo(nlan,3266,4692)
global.Wait(5)
camera.ChangeCameraStatic(3141,2447,4947,3177,2454,4854)
camera.ResetLerp(35000)
camera.ChangeCameraStatic(3192,2447,4966,3228,2454,4874) 

global.WaitForNpcPos(nlan,3266,4692)
global.Wait(0.5)
npc.SetAnimSpeed(nlan,100)
npc.SetAnim(nlan,235)
global.Wait(2.5)
--平生不会相思，才会相思，便害相思，却不得思。大叔cp多好啊多好啊
ui.Dialog(85350,0,5,0,0,0)--很多年前，我以为自己会失去一切的时候，有人跟我说，“总会有希望的”。
global.Wait(1)
ui.Dialog(85351,0,5,0,0,0)--那天之后，我总是想起这句话，日复一日，年复一年……

--当前乐淡出
global.MusicFadeOut(6000,100,0)  
global.Wait(3)

--鸟叫声 
global.PlaySound(4101,90)

camera.ResetLerp(0)
camera.ChangeCameraStatic(3126,2454,4867,3186,2463,4788)
camera.ResetLerp(25000)
camera.ChangeCameraStatic(3148,2457,4838,3208,2466,4758)
global.Wait(2)


--枝叶响动声
global.PlaySound(4133,50)
global.Wait(1.5)
--脚步声跑
global.PlaySoundLoop(2075,80)
global.Wait(2)
global.StopLastSound()
global.Wait(0.5)
--脚步声走
global.PlaySoundLoop(2080,80)
 
--夏侯
npc.Create(1,1,3046,4709)
npc.SetAt(1,1,0)
npc.TurnToPos(1,3266,4692)

--瑕
npc.Create(2,2,3060,4722)
npc.SetAt(2,0,1)
npc.TurnToPos(2,3266,4692)
wt(1)

npc.SetHeadRotTo(nxia,nlan,1,100)
npc.SetHeadRotTo(1,nlan,1,100)

--停止脚步声 
global.StopLastSound() 

camera.ResetLerp(0)
camera.ChangeCameraStatic(3114,2441,4716,2703,2447,4679)

npc.SetAnim(nlan,200)--动作归位
npc.SetHeadRot(nlan,0,-15,0,60)

effect.FadeIn(1,1.5)
global.Wait(1)

global.PlayMusic(182,100)

npc.SetAnim(2,212,2)
global.PlaySound(76707,200)

global.Wait(2.5)

effect.MotionBlur(1)
camera.ResetLerp(400)
camera.ChangeCameraStatic(3364,2451,4736,2703,2447,4579)
global.Wait(0.3)

npc.SetAnimSpeed(nxia,2000)
npc.SetAnim(2,212,2)
global.SetMotionSpeed(5)

effect.MotionBlur(0)
effect.FadeOutWhite(1,20)
global.Wait(1)


global.SetMotionSpeed(100)
camera.ResetLerp(0)
camera.ChangeCameraStatic(3236,2442,4729,3307,2458,4641)

effect.FadeInWhite(1,1)
global.Wait(1)

npc.SetHeadRot(nlan,-60,5,0,60)--回头

global.Wait(2)

camera.ResetLerp(0)
camera.ChangeCameraStatic(3364,2451,4736,2703,2447,4579)
effect.FadeIn(1,0.5)

npc.SetSpeed(nxia,0.2)
npc.SetAnimSpeed(nxia,30)

npc.SetAnim(2,212,2)
global.Wait(1)

npc.SetAppearTime(1,4)
npc.SetAppearTime(nxia,4)

npc.SetAppear(1,0)
global.Wait(0.5)

npc.SetAppear(nxia,0)
global.Wait(1)

npc.TurnToPos(nlan,3273,4728)--转身

camera.ResetLerp(16000)
camera.ChangeCameraStatic(3554,2481,4736,2703,2447,4679)
wt(3)
npc.SetHeadRot(nlan,0,0)
npc.MoveTo(nlan,3156,4691,1)
wt(2)
--兰抬头
npc.SetAnim(nlan,235)

wt(1.5)

global.EnableSkipDialog(0)
ui.Dialog_t(85352,100,0,nlan,0,0,1.5)--……
wt(1.5)
ui.Dialog_t(85353,100,0,nlan,0,0,4)--我等你们回来。

wt(2.5)

global.EnableSkipDialog(1)

camera.ResetLerp(20000)
camera.ChangeCameraStatic(4184,2971,4736,2703,2447,4679)

wt(15)

global.MusicFadeOut(7000,100,0)

effect.FadeOutWhite(1,0.1)
global.Wait(9)

global.StopLastSound()
global.PlayMusic(170,0)
global.PlayMusic(223,0)
global.PlayMusic(224,0)
global.PlayMusic(221,0)
global.PlayMusic(222,0)
global.PlayMusic(-1,0)
global.StopLastSound()

--进黑屏地图
map.ChangeNoScript(1,1099)
player.SetPos(2522,2538)
npc.Create(4,4,2522,2538)

--logo乐
global.PlayMusic(182,100)

--flash
global.CreateCameraSE(4,5907,1)
effect.FadeInWhite(1,0.3)
global.Wait(5)


global.SetWideScreen(0)

flag.SetValue(6001,451)

--开启多周目
C=global.GetGameCycle()
if c==0 then
global.SetGameCycle(2)
else
global.SetGameCycle(C+1)
end
global.PlayMusic(170,0)
global.PlayMusic(223,0)
global.PlayMusic(224,0)
global.PlayMusic(221,0)
global.PlayMusic(222,0)
global.PlayMusic(-1,0)
global.Restart()
--effect.FadeIn(1,1)

--end

end


