------------------------------------------------------------------------------------
--Name:  	201111[简体征服][任务脚本]战士觉醒任务-烽火台击鼓
--Creator:	冯子鑫
--Created:	2020-11-11
------------------------------------------------------------------------------------
--/callluafunc </F>User_PlayPlot</N>95


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

--bnw_bt.wav 鼓声

local hero = CppScriptMgr:QueryHero()

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

-- 鼓
local Drum1 = CppScriptMgr:AddSimplePlayer(46267,90,69, "Peace Army War Drum")
Drum1:SetPos(90,69)

-- Drum1:SetZoomPercent(150)

CppScriptMgr:WaitMilSec(1000)

hero:RunTo(91,72)
CppScriptMgr:WaitMilSec(1000)

hero:SetDir(4)

-- 击鼓
CppScriptMgr:WaitMilSec(1000)
hero:SetAction(404)
CppScriptMgr:PlaySound("Sound/bnw_bt.wav", 0,1)
-- local effectObj7  = CppScriptMgr:AddEffect("zsl_jiguR",95,74)
Drum1:AddEffect("zsl_jiguR")

CppScriptMgr:WaitMilSec(1000)
hero:SetAction(404)
CppScriptMgr:PlaySound("Sound/bnw_bt.wav", 0,1)

CppScriptMgr:WaitMilSec(1000)
hero:SetAction(404)
CppScriptMgr:PlaySound("Sound/bnw_bt.wav", 0,1)

CppScriptMgr:WaitMilSec(1000)
-- CppScriptMgr:ClearEffect(effectObj7)
Drum1:DelEffect("zsl_jiguR")
CppScriptMgr:WaitMilSec(1000)
hero:SetDir(0)

-- 生成五波魔军

local Monster11 = CppScriptMgr:AddPlayer(154,77,86, "Angry Beast [Evil]")
local Monster12 = CppScriptMgr:AddPlayer(154,79,88, "")
local Monster13 = CppScriptMgr:AddPlayer(154,81,90, "")
local Monster14 = CppScriptMgr:AddPlayer(154,77,89, "")
local Monster15 = CppScriptMgr:AddPlayer(154,79,91, "")

local Monster21 = CppScriptMgr:AddPlayer(263,110,85, "")
local Monster22 = CppScriptMgr:AddPlayer(263,107,085, "Demon Soldier [Evil]")
local Monster23 = CppScriptMgr:AddPlayer(263,104,086, "")
local Monster24 = CppScriptMgr:AddPlayer(263,108,088, "")
local Monster25 = CppScriptMgr:AddPlayer(263,106,089, "")

local Monster31 = CppScriptMgr:AddPlayer(225,86,91, "")
local Monster32 = CppScriptMgr:AddPlayer(225,88,90, "Talon [Evil]")
local Monster33 = CppScriptMgr:AddPlayer(225,90,90, "")
local Monster34 = CppScriptMgr:AddPlayer(225,88,92, "")
local Monster35 = CppScriptMgr:AddPlayer(225,91,92, "")

local Monster41 = CppScriptMgr:AddPlayer(604,76,93, "")
local Monster42 = CppScriptMgr:AddPlayer(604,79,94, "Snakeman [Evil]")
local Monster43 = CppScriptMgr:AddPlayer(604,82,95, "")
local Monster44 = CppScriptMgr:AddPlayer(604,78,96, "")
local Monster45 = CppScriptMgr:AddPlayer(604,79,98, "")

local Monster51 = CppScriptMgr:AddPlayer(211,107,095,"")
local Monster52 = CppScriptMgr:AddPlayer(211,109,93, "Phantom Soldier [Evil]")
local Monster53 = CppScriptMgr:AddPlayer(211,111,91, "")
local Monster54 = CppScriptMgr:AddPlayer(211,110,96, "")
local Monster55 = CppScriptMgr:AddPlayer(211,113,94, "")

Monster11:RunTo(85,71)
Monster12:RunTo(87,74)
Monster13:RunTo(88,76)
Monster14:RunTo(82,73)
Monster15:RunTo(84,76)

Monster21:RunTo(98,69)
Monster22:RunTo(97,72)
Monster23:RunTo(95,75)
Monster24:RunTo(97,74)
Monster25:RunTo(98,71)

Monster31:RunTo(89,76)
Monster32:RunTo(91,76)
Monster33:RunTo(94,76)
Monster34:RunTo(92,79)
Monster35:RunTo(94,79)

Monster41:RunTo(86,78)
Monster42:RunTo(87,78)
Monster43:RunTo(92,80)
Monster44:RunTo(87,82)
Monster45:RunTo(90,83)

Monster51:RunTo(98,78)
Monster52:RunTo(100,75)
Monster53:RunTo(100,71)
Monster54:RunTo(101,76)
Monster55:RunTo(103,74)


CppScriptMgr:WaitMilSec(4000)
Monster31:SetDir(4)
Monster32:SetDir(4)
Monster33:SetDir(4)
Monster34:SetDir(4)
Monster35:SetDir(4)
Monster42:Say("Surrender to Demon King! You`ve got nowhere to run.", 3000)
Monster52:Say("Surrender now! You`ve got nowhere to run.", 3000)
CppScriptMgr:WaitMilSec(1000)
Monster22:Say("Demon King said `Catch them alive!`", 3000)
--玩家
CppScriptMgr:NpcCallOut("Finally! Come! Let the will burn!\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)

--郑东江
CppScriptMgr:NpcCallOut("Zheng Dongjiang from Peace Army is here to help!\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc190", 150, 430, "Zheng Dongjiang", 250, 655)
CppScriptMgr:WaitMilSec(1500)

local General1 = CppScriptMgr:AddPlayer(8,89,97, "Zheng Dongjiang")
General1:SetZoomPercent(100)
General1:SetArmor(187465,0,1)
General1:SetRWeapon(410389,0,1)
General1:SetLWeapon(900309,0,1)


local General2 = CppScriptMgr:AddPlayer(8,094,096, "Han Jingzhong")
General2:SetZoomPercent(100)
General2:SetArmor(189075,0,1)
General2:SetRWeapon(450329,0,1)
General2:SetLWeapon(450329,0,1)


local General3 = CppScriptMgr:AddPlayer(8,99,96, "Xue Wenzong")
General3:SetZoomPercent(100)
General3:SetArmor(187505,0,1)
General3:SetRWeapon(420389,0,1)
General3:SetLWeapon(420389,0,1)


local General4 = CppScriptMgr:AddPlayer(8,92,99, "Jing Wuwei")
General4:SetZoomPercent(100)
General4:SetArmor(187425,0,1)
General4:SetRWeapon(450329,0,1)
General4:SetLWeapon(450329,0,1)


local General5 = CppScriptMgr:AddPlayer(8,96,99, "Zhao Tiejun")
General5:SetZoomPercent(100)
General5:SetArmor(194895,0,1)
General5:SetRWeapon(420389,0,1)
General5:SetLWeapon(420389,0,1)

General5:SetHair(21,1)


local General6 = CppScriptMgr:AddPlayer(8,101,99, "Song Danxin")
General6:SetZoomPercent(100)
General6:SetArmor(194885,0,1)
General6:SetRWeapon(420389,0,1)
General6:SetLWeapon(420389,0,1)
General6:SetHair(21,1)


local Guard1 = CppScriptMgr:AddPlayer(910,89,106, "")
Guard1:SetZoomPercent(100)
Guard1:SetDir(4)

local Guard2 = CppScriptMgr:AddPlayer(910,91,105, "")
Guard1:SetZoomPercent(100)
Guard1:SetDir(4)

local Guard3 = CppScriptMgr:AddPlayer(910,92,105, "")
Guard1:SetZoomPercent(100)
Guard1:SetDir(4)

local Guard4 = CppScriptMgr:AddPlayer(910,95,109, "")
Guard4:SetZoomPercent(100)
Guard4:SetDir(4)

local Guard5 = CppScriptMgr:AddPlayer(910,92,109, "")
Guard5:SetZoomPercent(100)
Guard5:SetDir(4)

local Guard6 = CppScriptMgr:AddPlayer(910,95,113, "")
Guard5:SetZoomPercent(100)
Guard5:SetDir(4)

local Guard7 = CppScriptMgr:AddPlayer(910,97,118, "")
Guard7:SetZoomPercent(100)
Guard7:SetDir(4)

local Guard8 = CppScriptMgr:AddPlayer(910,99,117, "")
Guard8:SetZoomPercent(100)
Guard8:SetDir(4)

local Guard9 = CppScriptMgr:AddPlayer(910,102,117, "")
Guard9:SetZoomPercent(100)
Guard9:SetDir(4)


General1:RunTo(101,81)

General2:RunTo(105,78)

General3:RunTo(107,73)

General4:RunTo(90,88)

General5:RunTo(85,86)

General6:RunTo(82,83)

Guard1:RunTo(80,85)
Guard2:RunTo(83,89)
Guard3:RunTo(87,91)
Guard4:RunTo(109,79)
Guard5:RunTo(92,91)
Guard6:RunTo(102,92)
Guard7:RunTo(102,87)
Guard8:RunTo(106,84)
Guard9:RunTo(97,92)

Guard3:Say("Kill the demons! For General Xiao!",6500)
Guard6:Say("Kill the demons! For General Xiao!",6500)
Guard8:Say("Kill the demons! For General Xiao!",6500)
General2:Say("Don`t worry! Peace Army is here!",6500)
General4:Say("We`re here to help you!",6500)
General6:Say("Go to hell! Demons!",6500)

CppScriptMgr:WaitMilSec(4500)



Guard1:SetDir(5)
Guard2:SetDir(5)
Guard3:SetDir(5)
Guard9:SetDir(4)
Guard5:SetDir(4)

--逐帧配置
General6:SetDir(5)
General4:SetDir(5)
General4:SetAction(404)
Monster45:SetAction(330)
General5:SetDir(5)
General5:SetAction(404)
Monster44:SetAction(330)
General1:SetDir(3)
General1:SetAction(404)
Monster51:SetAction(330)
CppScriptMgr:WaitMilSec(900)




Guard1:SetDir(5)
General2:SetDir(3)
General2:SetAction(404)
Monster54:SetAction(330)
Monster51:SetPos(1000,1000)
Monster45:SetPos(1000,1000)
Monster44:SetPos(1000,1000)
CppScriptMgr:WaitMilSec(900)

General3:SetDir(2)
General3:SetAction(404)
Monster55:SetAction(330)
Monster54:SetPos(1000,1000)
CppScriptMgr:WaitMilSec(900)

Guard6:SetDir(3)
Guard7:SetDir(3)
Guard8:SetDir(3)
Guard4:SetDir(3)
Monster55:SetPos(1000,1000)
CppScriptMgr:WaitMilSec(900)
Guard6:SetDir(3)
Guard7:SetDir(3)
Guard8:SetDir(3)
Guard4:SetDir(3)

Monster41:SetDir(0)
Monster42:SetDir(0)
Monster43:SetDir(0)
Monster44:SetDir(0)
Monster45:SetDir(0)

Monster51:SetDir(7)
Monster52:SetDir(7)
Monster53:SetDir(7)
Monster54:SetDir(7)
Monster55:SetDir(7)

General1:RunTo(98,78)
Monster41:SetAction(404)
Monster42:SetAction(404)
Monster43:SetAction(404)
Monster44:SetAction(404)
Monster45:SetAction(404)

Monster51:SetAction(401)
Monster52:SetAction(401)
Monster53:SetAction(401)
Monster54:SetAction(401)
Monster55:SetAction(401)

General2:SetAction(404)
General3:SetAction(404)
General4:SetAction(404)
General5:SetAction(404)
General6:SetAction(404)

CppScriptMgr:WaitMilSec(1000)

General1:SetDir(3)
General1:SetAction(404)
Monster23:SetAction(330)
CppScriptMgr:WaitMilSec(1000)


Monster23:SetPos(1000,1000)
CppScriptMgr:WaitMilSec(1000)

Monster43:Say("Kill them all!", 3000)
Monster22:Say("Who`s out there?", 3000)
--玩家
CppScriptMgr:NpcCallOut("Thank you for your help! I`ll help you find General Xiao!\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)

--郑东江
CppScriptMgr:NpcCallOut("You`re welcome! We`ll stop the demons, and you can go find General Xiao!\n\n\n\n                                     Click ESC to skip the story.", 2000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc190", 150, 430, "Zheng Dongjiang", 250, 655)
CppScriptMgr:WaitMilSec(2000)

--薛文踪
CppScriptMgr:NpcCallOut("Comrades! Cover the hero!\n\n\n\n                                     Click ESC to skip the story.", 1000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc188", 150, 430, "Xue Wenzong", 250, 655)
CppScriptMgr:WaitMilSec(1000)

-- 离开战场
hero:JumpTo(98,78)
Monster33:SetAction(404)
Monster35:SetAction(404)
Monster33:Say("Stop!", 2000)
General1:RunTo(100,133)
General3:RunTo(102,133)

CppScriptMgr:WaitMilSec(900)
hero:RunTo(104,133)



CppScriptMgr:WaitMilSec(6000)


CppScriptMgr:SetViewPosByCell(79,88)

-- 铁拳魔君出场
local effectObj1 = CppScriptMgr:AddEffect("zf2-e224",77,95)

CppScriptMgr:WaitMilSec(1000)
local Boss = CppScriptMgr:AddPlayer(146,77,95, "Iron Fist")
Boss:SetZoomPercent(200)
Boss:SetDir(5)
CppScriptMgr:WaitMilSec(2000)

CppScriptMgr:ClearEffect(effectObj1)
CppScriptMgr:WaitMilSec(1000)

Boss:SetAction(404)

local effectObj2 = CppScriptMgr:AddEffect("xidag_bafi",84,087);

CppScriptMgr:WaitMilSec(1000)

General4:SetAction(330)
General5:SetAction(330)
General6:SetAction(330)
Guard1  :SetAction(330)
Guard2  :SetAction(330)
Guard3  :SetAction(330)
Guard5  :SetAction(330)

CppScriptMgr:WaitMilSec(2000)

CppScriptMgr:ClearEffect(effectObj2)

-- CppScriptMgr:WaitMilSec(1000)

General4:SetPos(1000,1000)
General5:SetPos(1000,1000)
General6:SetPos(1000,1000)
Guard1  :SetPos(1000,1000)
Guard2  :SetPos(1000,1000)
Guard3  :SetPos(1000,1000)
Guard5  :SetPos(1000,1000)

--铁拳魔君
CppScriptMgr:NpcCallOut("Xiao, I`ll defeat you all!\n\n\n\n                                     Click ESC to skip the story.", 2000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc7126", 150, 430, "Iron Fist", 250, 655)

local effectObj3 = CppScriptMgr:AddEffect("zf2-e224",77,95)

CppScriptMgr:WaitMilSec(2000)
Boss:SetPos(1000,1000)

CppScriptMgr:WaitMilSec(2000)





