------------------------------------------------------------------------------------
--Name:  	201111[简体征服][任务脚本]战士觉醒任务-祭拜镇远军
--Creator:	冯子鑫
--Created:	2020-11-11
------------------------------------------------------------------------------------
--/callluafunc </F>User_PlayPlot</N>111


-- 设置摄像机指向位置(网格坐标)
CppScriptMgr:SetViewPosByCell(118,142)
------------------------------------------------------------
--玩家对象操作接口,Hero、Player、Npc接口都一样
-- 查询/创建，玩家自己
-- 参数：无
-- local hero = CppScriptMgr:QueryHero()
-- 创建人物接口：CppScriptMgr:AddPlayer(外观look, 坐标x, 坐标y, "名字", id, 角色类型luaPlayerType)
-- local player = CppScriptMgr:AddPlayer(276, 325, 345, "新手勇士", 4003000001)


-- 创建玩家形象

local hero = CppScriptMgr:QueryHero()

hero:SetPos(122,197)
hero:SetDir(4)
local sex = hero:GetSex()
local touxiang = "NPCBust_npc27064"
if sex == 2 then 
	touxiang = "NPCBust_npc185"
end

local Name = hero:GetName()
local Soul = 45264
-- 生成玩家的灵魂
if sex == 2 then
	Soul = 45264
end
local HeroSoul = CppScriptMgr:AddSimplePlayer(Soul,120,146,Name);
HeroSoul:SetDir(2)

CppScriptMgr:SetLightScreen(3000)
CppScriptMgr:WaitMilSec(3000)

-- 生成三大将领
local General1 = CppScriptMgr:AddSimplePlayer(1056710,101,50, "[Oriental Warlord] Hua Mulan");
General1:SetZoomPercent(130)
-- General1:SetArmor(131235,0,1)
-- General1:SetRWeapon(560450,0,1)
-- General1:SetLWeapon(560460,0,1)
-- General1:SetArmet(118209,0,1)
-- General1:SetHair(95,1)
General1:SetDir(0)
local General4 = CppScriptMgr:AddSimplePlayer(1056720,95,45, "[Greek Warlord] Ares");
General4:SetZoomPercent(130)
-- General4:SetArmor(131235,0,1)
-- General4:SetRWeapon(420439,0,1)
-- General4:SetLWeapon(900309,0,1)
-- General4:SetArmet(111309,0,1)
-- General4:SetHair(95,1)
General4:SetDir(0)
local General5 = CppScriptMgr:AddSimplePlayer(1056730,106,45, "[Northern Europe Warlord] Tyre");
General5:SetZoomPercent(130)
-- General5:SetArmor(131235,0,1)
-- General5:SetRWeapon(410439,0,1)
-- General5:SetLWeapon(420439,0,1)
-- General5:SetArmet(111309,0,1)
-- General5:SetHair(95,1)
General5:SetDir(0)


--玩家
CppScriptMgr:NpcCallOut("Is it what happened on the way when General Xiao went to back up the Remote City?\n\n\n\n                                     Click ESC to skip the story.", 2000, 1, "NPCBust_bg", "", 320, 570, 400, 580, touxiang, 150, 430, hero:GetName(), 250, 655)
CppScriptMgr:WaitMilSec(2000)

-- 生成三魔将
local Monster1 = CppScriptMgr:AddPlayer(353,108,157, "Abyss Evil Lord")
Monster1:SetZoomPercent(120)
Monster1:SetDir(5)

local Monster2 = CppScriptMgr:AddPlayer(279,103,156, "Bloody Wolf")
Monster2:SetZoomPercent(120)
Monster2:SetDir(5)

local Monster3 = CppScriptMgr:AddPlayer(277,109,161, "Dark Wing Evil")
Monster3:SetZoomPercent(120)
Monster3:SetDir(5)

-- 生成萧无定
local General = CppScriptMgr:AddPlayer(8,111,167, "General Xiao")
General:SetZoomPercent(100)
General:SetRWeapon(560339,0,1)
General:SetLWeapon(560339,0,1)
General:SetArmet(195735,0,1)
General:SetHair(95,1)

Monster1:RunTo(116,142)
CppScriptMgr:WaitMilSec(1000)
Monster2:RunTo(112,144)
Monster3:RunTo(118,147)
General:RunTo(110,155)

-- 118 142 - 110 150
-- for i = 0,8 do
	-- local nPoX = 118 - i
	-- local nPoY = 142 + i
	-- CppScriptMgr:SetViewPosByCell(nPoX,nPoY)
	-- CppScriptMgr:WaitMilSec(50)
-- end
CppScriptMgr:WaitMilSec(1000)
CppScriptMgr:SetViewPosByCell(110,150)
CppScriptMgr:WaitMilSec(1400)

General:SetDir(5)
CppScriptMgr:WaitMilSec(1400)
Monster1:SetDir(1)
Monster2:SetDir(1)
Monster3:SetDir(1)
CppScriptMgr:WaitMilSec(700)

--萧无定
CppScriptMgr:NpcCallOut("Abyss Evil Lord, just surrender! You have no where to run!\n\n\n\n                                     Click ESC to skip the story.", 2000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27644", 150, 430, "General Xiao", 250, 655)
CppScriptMgr:WaitMilSec(2000)

--深渊魔君
CppScriptMgr:NpcCallOut("Surrender? Don`t you get it by now? General Xiao!\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc7135", 150, 430, "Abyss Evil Lord", 250, 655)
CppScriptMgr:WaitMilSec(1500)

--萧无定
CppScriptMgr:NpcCallOut("Get what? Die in hell!\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27644", 150, 430, "General Xiao", 250, 655)
CppScriptMgr:WaitMilSec(1500)

General:RunTo(111,149)

CppScriptMgr:WaitMilSec(1200)
General:SetAction(401)
CppScriptMgr:WaitMilSec(200)
Monster2:SetAction(310)


--深渊魔君
CppScriptMgr:NpcCallOut("Hahaha... This will be your last struggle.\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc7135", 150, 430, "Abyss Evil Lord", 250, 655)
CppScriptMgr:WaitMilSec(1500)

--萧无定
CppScriptMgr:NpcCallOut("No! We`ve been set up!\n\n\n\n                                     Click ESC to skip the story.", 1000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27644", 150, 430, "General Xiao", 250, 655)
CppScriptMgr:WaitMilSec(1000)

--深渊魔君
CppScriptMgr:NpcCallOut("Yes, you`re right. Our real purpose is taking the Remote City!\n\n\n\n                                     Click ESC to skip the story.", 2000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc7135", 150, 430, "Abyss Evil Lord", 250, 655)
CppScriptMgr:WaitMilSec(2000)

local effectObj1 = CppScriptMgr:AddEffect("zf2-e224",115,144)
CppScriptMgr:WaitMilSec(1500)

Monster1:SetPos(1000,1000)
Monster2:SetPos(1000,1000)
Monster3:SetPos(1000,1000)

CppScriptMgr:ClearEffect(effectObj1)

--萧无定
CppScriptMgr:NpcCallOut("I need to go back right now!\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27644", 150, 430, "General Xiao", 250, 655)
CppScriptMgr:WaitMilSec(1500)

General:SetDir(1)
local effectObj21 = CppScriptMgr:AddEffect("windupatt907",112,167)
local effectObj22 = CppScriptMgr:AddEffect("windupatt907",113,166)
local effectObj23 = CppScriptMgr:AddEffect("windupatt907",110,165)

CppScriptMgr:WaitMilSec(500)
General:SetDir(1)
General:Say("!!!",1500)

local effectObj31 = CppScriptMgr:AddEffect("windupatt907",112,167)
local effectObj32 = CppScriptMgr:AddEffect("windupatt907",113,166)
local effectObj33 = CppScriptMgr:AddEffect("windupatt907",110,165)

CppScriptMgr:WaitMilSec(500)

local effectObj41 = CppScriptMgr:AddEffect("windupatt907",112,167)
local effectObj42 = CppScriptMgr:AddEffect("windupatt907",113,166)
local effectObj43 = CppScriptMgr:AddEffect("windupatt907",110,165)

CppScriptMgr:WaitMilSec(500)

local effectObj51 = CppScriptMgr:AddEffect("windupatt907",112,167)
local effectObj52 = CppScriptMgr:AddEffect("windupatt907",113,166)
local effectObj53 = CppScriptMgr:AddEffect("windupatt907",110,165)

General:RunTo(115,145)

-- 110 150 - 118 142 
for i = 0,8 do
	local nPoX = 110 + i
	local nPoY = 150 - i
	CppScriptMgr:SetViewPosByCell(nPoX,nPoY)
	CppScriptMgr:WaitMilSec(80)
end

local effectObj2  = CppScriptMgr:AddEffect("zf2-e281",115,139)

CppScriptMgr:WaitMilSec(500)
local Guard1 = CppScriptMgr:AddSimplePlayer(1065291,115,139, "Holy Defender")
Guard1:SetArmor(194885,0,1)
Guard1:SetRWeapon(560339,0,1)
Guard1:SetLWeapon(900259,0,1)
Guard1:SetWingInfo(6004,12,0)
Guard1:SetHair(55,1)
CppScriptMgr:WaitMilSec(500)
CppScriptMgr:ClearEffect(effectObj2)
Guard1:Say("Warlord Shrine will never allow outsiders to desecrate it!",2000)

--神卫兵
CppScriptMgr:NpcCallOut("Human, you can`t get through here!\n\n\n\n                                     Click ESC to skip the story.", 1000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc184", 150, 430, "Holy Defender", 250, 655)
CppScriptMgr:WaitMilSec(1000)

General:Say("!!!",1500)
CppScriptMgr:WaitMilSec(1500)

--萧无定
CppScriptMgr:NpcCallOut("Who are you?\n\n\n\n                                     Click ESC to skip the story.", 1000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27644", 150, 430, "General Xiao", 250, 655)
CppScriptMgr:WaitMilSec(1000)

--神卫兵
CppScriptMgr:NpcCallOut("Human, you can`t get through here!\n\n\n\n                                     Click ESC to skip the story.", 1000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc184", 150, 430, "Holy Defender", 250, 655)
CppScriptMgr:WaitMilSec(1000)

--萧无定
CppScriptMgr:NpcCallOut("I gotta go back to Remote City. Please!\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27644", 150, 430, "General Xiao", 250, 655)
CppScriptMgr:WaitMilSec(1500)

--神卫兵
CppScriptMgr:NpcCallOut("Human, you can`t get through here!\n\n\n\n                                     Click ESC to skip the story.", 1000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc184", 150, 430, "Holy Defender", 250, 655)
CppScriptMgr:WaitMilSec(1000)

--萧无定
CppScriptMgr:NpcCallOut("Pardon me!\n\n\n\n                                     Click ESC to skip the story.", 1000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27644", 150, 430, "General Xiao", 250, 655)
CppScriptMgr:WaitMilSec(1000)

General:SetAction(401)
CppScriptMgr:WaitMilSec(200)
Guard1:SetAction(310)

CppScriptMgr:WaitMilSec(1300)

General:SetAction(905)
CppScriptMgr:WaitMilSec(500)

local effectObj3 = CppScriptMgr:AddEffect("longpi4_452",115,141)

CppScriptMgr:WaitMilSec(500)
Guard1:SetAction(330)
Guard1:Say("How could I be defeated?",2000)
CppScriptMgr:WaitMilSec(2000)
local effectObj7  = CppScriptMgr:AddEffect("archer-s",115,139)
CppScriptMgr:WaitMilSec(1000)

Guard1:SetPos(1000,1000)
General:Say("I`m sorry!",1500)
CppScriptMgr:ClearEffect(effectObj7)
CppScriptMgr:WaitMilSec(1000)

-- 神秘声音
CppScriptMgr:NpcCallOut("You are a good candidate. I can see the will of the warlords in you.\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "", 150, 430, "Mysterious Voice", 250, 1655)
CppScriptMgr:WaitMilSec(1500)

--萧无定
CppScriptMgr:NpcCallOut("Who is it? Get out!\n\n\n\n                                     Click ESC to skip the story.", 1000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27644", 150, 430, "General Xiao", 250, 655)
CppScriptMgr:WaitMilSec(1000)

-- 神秘声音
CppScriptMgr:NpcCallOut("Warlord must be fearless. You have no other choices if you want to save Peace Army.\n\n\n\n                                     Press ESC to skip the story.", 2000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "", 150, 430, "Mysterious Voice", 250, 1655)
CppScriptMgr:WaitMilSec(2000)

--萧无定
CppScriptMgr:NpcCallOut("Conspiracies won`t scare me off!\n\n\n\n                                     Press ESC to skip the story.", 1000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27644", 150, 430, "General Xiao", 250, 655)
CppScriptMgr:WaitMilSec(1000)

General:RunTo(113,114)

--玩家
CppScriptMgr:NpcCallOut("Isn`t it the place where General Xiao found the Warlord Shrine?\n\n\n\n                                     Click ESC to skip the story.", 2000, 1, "NPCBust_bg", "", 320, 570, 400, 580, touxiang, 150, 430, hero:GetName(), 250, 655)
CppScriptMgr:WaitMilSec(2000)

HeroSoul:RunTo(113,114)
HeroSoul:Say("Let`s go take a look.",3000)

CppScriptMgr:WaitMilSec(3000)

CppScriptMgr:SetViewPosByCell(101,56)
-- 生成萧无定


local General2 = CppScriptMgr:AddPlayer(8,103,67, "General Xiao")
General2:SetZoomPercent(100)
General2:SetRWeapon(560339,0,1)
General2:SetLWeapon(560339,0,1)
General2:SetArmet(195735,0,1)
General2:SetHair(95,1)
General2:SetZoomPercent(100)

local HeroSoul2 = CppScriptMgr:AddSimplePlayer(Soul,104,074,Name);

General2:RunTo(101,56)
HeroSoul2:RunTo(103,65)

CppScriptMgr:WaitMilSec(2500)
General2:SetDir(4)
HeroSoul2:SetDir(4)
-- 神秘声音
CppScriptMgr:NpcCallOut("Good! Are you willing to be my believer and pass on my will?\n\n\n\n                                     Press ESC to skip the story.", 2000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "", 150, 430, "Mysterious Voice", 250, 1655)
CppScriptMgr:WaitMilSec(2000)

--萧无定
CppScriptMgr:NpcCallOut("Who are you?\n\n\n\n                                     Press ESC to skip the story.", 1000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27644", 150, 430, "General Xiao", 250, 655)
CppScriptMgr:WaitMilSec(1000)

-- 神秘声音
CppScriptMgr:NpcCallOut("I am Hua Mulan, the formidable female warlord.\n\n\n\n                                     Press ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27641", 150, 430, "Hua Mulan", 250, 655)
CppScriptMgr:WaitMilSec(1500)

--萧无定
CppScriptMgr:NpcCallOut("Hua Mulan?\n\n\n\n                                     Click ESC to skip the story.", 1000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27644", 150, 430, "General Xiao", 250, 655)
CppScriptMgr:WaitMilSec(1000)

--玩家
CppScriptMgr:NpcCallOut("I see that`s how General Xiao got the will of the warlords.\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, touxiang, 150, 430, hero:GetName(), 250, 655)
CppScriptMgr:WaitMilSec(1500)

--萧无定
CppScriptMgr:NpcCallOut("If you can save the Peace Army. I would be love to.\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27644", 150, 430, "General Xiao", 250, 655)
CppScriptMgr:WaitMilSec(1500)

-- 神秘声音
CppScriptMgr:NpcCallOut("Great. You`ll get my will now.\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "", 150, 430, "Mysterious Voice", 250, 1655)
CppScriptMgr:WaitMilSec(1500)

local effectObj4 = CppScriptMgr:AddEffect("zf2-e128",101,56)

CppScriptMgr:WaitMilSec(1000)
General2:SetPos(1000,1000)
local General3 = CppScriptMgr:AddSimplePlayer(1056744,101,56, "General Xiao")
General3:SetDir(4)
CppScriptMgr:WaitMilSec(1000)
CppScriptMgr:ClearEffect(effectObj4)
CppScriptMgr:WaitMilSec(2500)

--萧无定
CppScriptMgr:NpcCallOut("Hero, come here!\n\n\n\n                                     Click ESC to skip the story.", 1000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27644", 150, 430, "General Xiao", 250, 655)
CppScriptMgr:WaitMilSec(1000)

--玩家
CppScriptMgr:NpcCallOut("Me? Isn`t it a dream?\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, touxiang, 150, 430, hero:GetName(), 250, 655)
CppScriptMgr:WaitMilSec(1500)

local effectObj5 = CppScriptMgr:AddEffect("angelwing",103,65)
CppScriptMgr:WaitMilSec(1500)
HeroSoul2:SetPos(1000,1000)
local hero2 = CppScriptMgr:QueryHero()
hero2:SetRWeapon(0,0,1)
hero2:SetLWeapon(0,0,1)
hero2:SetPos(103,65)
hero2:SetDir(4)
CppScriptMgr:WaitMilSec(1000)
hero2:WalkTo(99,56)
General3:WalkTo(103,56)
CppScriptMgr:WaitMilSec(500)
General3:SetDir(2)



CppScriptMgr:WaitMilSec(1800)
hero2:SetDir(6)

--萧无定
CppScriptMgr:NpcCallOut("You have awakened the warlords and me! It looks like both of us have got the will of the warlords.\n\n\n\n                                     Click ESC to skip the story.", 2000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27644", 150, 430, "General Xiao", 250, 655)
CppScriptMgr:WaitMilSec(2000)

--玩家
CppScriptMgr:NpcCallOut("General Xiao, it was you who brought me into the memory of that old hero.\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, touxiang, 150, 430, hero:GetName(), 250, 655)
CppScriptMgr:WaitMilSec(1500)

--萧无定
CppScriptMgr:NpcCallOut("That`s right! I had defeated the evil lord with the power of the warlords, but I fell into deep sleep as well.\n\n\n\n                                     Click ESC to skip the story.", 2000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27644", 150, 430, "General Xiao", 250, 655)
CppScriptMgr:WaitMilSec(2000)

--玩家
CppScriptMgr:NpcCallOut("No wonder they couldn`t find you. Then you had been sleeping ever after?\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, touxiang, 150, 430, hero:GetName(), 250, 655)
CppScriptMgr:WaitMilSec(1500)

--萧无定
CppScriptMgr:NpcCallOut("Yes, until the three warlords were back to the Warlord Shrine.\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27644", 150, 430, "General Xiao", 250, 655)
CppScriptMgr:WaitMilSec(1500)

CppScriptMgr:SetViewPosByCell(101,50)
General3:SetDir(4)
hero2:SetDir(4)
--萧无定
CppScriptMgr:NpcCallOut("Warlord Hua Mulan guided us with her wisdom and courage.\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27644", 150, 430, "General Xiao", 250, 655)
General1:Say("Women are no inferior to men!",3000)
General1:SetAction(404)
CppScriptMgr:WaitMilSec(1500)

--萧无定
CppScriptMgr:NpcCallOut("Warlord Ares guided us with his blood and power.\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27644", 150, 430, "General Xiao", 250, 655)
General4:Say("I love the smell of blood!",3000)
General4:SetAction(402)
CppScriptMgr:WaitMilSec(1500)

--萧无定
CppScriptMgr:NpcCallOut("Warlord Tyre let us know the nature of war.\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27644", 150, 430, "General Xiao", 250, 655)
General5:Say("Take the punishment of justice!",2000)
General5:SetAction(403)
CppScriptMgr:WaitMilSec(1500)

CppScriptMgr:WaitMilSec(1500)
hero2:SetAction(220)
CppScriptMgr:WaitMilSec(500)
hero2:SetAction(220)
CppScriptMgr:WaitMilSec(500)
hero2:SetAction(220)
CppScriptMgr:WaitMilSec(500)
hero2:SetAction(220)
CppScriptMgr:WaitMilSec(500)
hero2:SetAction(220)
CppScriptMgr:WaitMilSec(500)
hero2:SetAction(220)
CppScriptMgr:WaitMilSec(500)

CppScriptMgr:WaitMilSec(2000)

-- 穿上战神装备
local effectObj6  = CppScriptMgr:AddEffect("zf2-e128",99,56)
CppScriptMgr:WaitMilSec(1000)
hero2:SetArmor(194885,0,1)
CppScriptMgr:WaitMilSec(1000)
General3:SetDir(2)
hero2:SetDir(6)

--萧无定
CppScriptMgr:NpcCallOut("It looks like you`ve been accepted by the warlords! Now it`s the time for you to call the Peace Army!\n\n\n\n                                     Click ESC to skip the story.", 2000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27644", 150, 430, "General Xiao", 250, 655)
CppScriptMgr:WaitMilSec(2500)



