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


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



local effectObj1 = CppScriptMgr:AddEffect("M_Fire",157,216);
local effectObj2 = CppScriptMgr:AddEffect("M_Fire",155,199);
local effectObj3 = CppScriptMgr:AddEffect("M_Fire",161,194);
local effectObj4 = CppScriptMgr:AddEffect("M_Fire",177,206);
local effectObj5 = CppScriptMgr:AddEffect("M_Fire",180,209);
local effectObj6 = CppScriptMgr:AddEffect("M_Fire",180,194);
local effectObj7 = CppScriptMgr:AddEffect("M_Fire",179,178);
-- local effectObj31 = CppScriptMgr:AddEffect("M_Fire",163,166);
-- local effectObj32 = CppScriptMgr:AddEffect("M_Fire",174,160);
local effectObj33 = CppScriptMgr:AddEffect("M_Fire",162,153);
local effectObj34 = CppScriptMgr:AddEffect("M_Fire",182,153);
-- local effectObj35 = CppScriptMgr:AddEffect("M_Fire",180,172);
local effectObj36 = CppScriptMgr:AddEffect("M_Fire",158,170);

local effectObj21 = CppScriptMgr:AddEffect("windupatt907",165,186);
local effectObj22 = CppScriptMgr:AddEffect("windupatt907",156,197);
local effectObj23 = CppScriptMgr:AddEffect("windupatt907",163,205);
local effectObj24 = CppScriptMgr:AddEffect("windupatt907",155,213);
local effectObj25 = CppScriptMgr:AddEffect("windupatt907",177,216);
local effectObj26 = CppScriptMgr:AddEffect("windupatt907",183,203);
local effectObj27 = CppScriptMgr:AddEffect("windupatt907",180,186);



-- CppScriptMgr:SetViewPosByCell(169,162);


local player1 = CppScriptMgr:AddSimplePlayer(10670,157,175, "Dead body of a Peace Army soldier", 400300001,1);
local player2 = CppScriptMgr:AddSimplePlayer(10670,159,206, "Wounded Peace Army soldier", 400300002,1);
local player3 = CppScriptMgr:AddSimplePlayer(10671,147,193, "Dead body of a Peace Army soldier", 400300003,1);
local player4 = CppScriptMgr:AddSimplePlayer(10673,160,185, "Dead body of a Peace Army soldier", 400300004,1);
local player5 = CppScriptMgr:AddSimplePlayer(10672,178,184, "Wounded Peace Army soldier", 400300005,1);
local player6 = CppScriptMgr:AddSimplePlayer(10676,184,221, "Dead body of a Peace Army soldier", 400300006,1);
local player7 = CppScriptMgr:AddSimplePlayer(10676,173,196, "Wounded Peace Army soldier", 400300007,1);
local player8 = CppScriptMgr:AddSimplePlayer(10677,181,184, "Dead body of a Peace Army soldier", 400300008,1);

local player101 = CppScriptMgr:AddSimplePlayer(10670,169,167, "")
local player102 = CppScriptMgr:AddSimplePlayer(10672,174,172, "")
local player103 = CppScriptMgr:AddSimplePlayer(10672,166,171, "")
local player104 = CppScriptMgr:AddSimplePlayer(10672,166,161, "")


player2:Say("General Xiao will come back and save us!",8000)
player5:Say("It`s getting harder to resist.",8000)
player7:Say("No surrender!",8000)
player101:Say("No surrender!",8000)
player102:Say("General Xiao will come back and save us!",8000)
player104:Say("It`s getting harder to resist.",8000)



--怪物

local playerMonster1 = CppScriptMgr:AddSimplePlayer(46364,162,224, "Dead Body of a Blade Evil Army soldier");
playerMonster1:SetZoomPercent(70)
playerMonster1:SetDir(0)


local playerMonster2 = CppScriptMgr:AddSimplePlayer(46364,162,209, "Dead Body of a Blade Evil Army soldier");
playerMonster2:SetZoomPercent(70)
playerMonster2:SetDir(0)



local playerMonster3 = CppScriptMgr:AddSimplePlayer(46364,152,195, "Dead Body of a Blade Evil Army soldier");
playerMonster3:SetDir(0)



local playerMonster4 = CppScriptMgr:AddSimplePlayer(46364,160,191, "Dead Body of a Blade Evil Army soldier");
playerMonster4:SetZoomPercent(70)
playerMonster4:SetDir(0)


local playerMonster5 = CppScriptMgr:AddSimplePlayer(46364,179,214, "Dead Body of a Blade Evil Army soldier");
playerMonster5:SetZoomPercent(70)
playerMonster5:SetDir(0)


local playerMonster6 = CppScriptMgr:AddSimplePlayer(46364,174,203, "Dead Body of a Blade Evil Army soldier");
playerMonster6:SetZoomPercent(70)
playerMonster6:SetDir(0)


local playerMonster7 = CppScriptMgr:AddSimplePlayer(46364,183,199, "Dead Body of a Blade Evil Army soldier");
playerMonster7:SetZoomPercent(70)
playerMonster7:SetDir(0)


local playerMonster8 = CppScriptMgr:AddSimplePlayer(46364,160,170, "Dead Body of a Blade Evil Army soldier");
playerMonster8:SetZoomPercent(70)
playerMonster8:SetDir(0)

local playerMonster100 = CppScriptMgr:AddSimplePlayer(46364,172,163, "");
local playerMonster101 = CppScriptMgr:AddSimplePlayer(46364,168,160, "");
local playerMonster102 = CppScriptMgr:AddSimplePlayer(46364,162,158, "");


local effectObj100 = CppScriptMgr:AddEffect("accession6",169,225);
CppScriptMgr:WaitMilSec(1000)


local hero = CppScriptMgr:QueryHero()

hero:SetPos(169,225);
hero:SetDir(4);
CppScriptMgr:ClearEffect(effectObj100)


local playerGuard1 = CppScriptMgr:AddPlayer(910,164,143, "Peace Defender")
playerGuard1:SetZoomPercent(100)
playerGuard1:SetDir(4)

local playerGuard2 = CppScriptMgr:AddPlayer(910,169,145, "Peace Defender")
playerGuard2:SetZoomPercent(100)
playerGuard2:SetDir(4)

local playerGuard3 = CppScriptMgr:AddPlayer(910,174,143, "Peace Defender")
playerGuard3:SetZoomPercent(100)
playerGuard3:SetDir(4)

local playerMonster9 = CppScriptMgr:AddPlayer(146,167,138, "Iron Fist")
playerMonster9:SetZoomPercent(200)
playerMonster9:SetDir(0)


CppScriptMgr:WaitMilSec(1000)


for i = 0,87 do
	local nPoY = 225 - i
	CppScriptMgr:SetViewPosByCell(169,nPoY)
	CppScriptMgr:WaitMilSec(50)
end

local sex = hero:GetSex()

CppScriptMgr:WaitMilSec(1000)

if sex == 1 then 
--玩家
CppScriptMgr:NpcCallOut("Is this still the Remote City?\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27064", 150, 430, hero:GetName(), 250, 655)
CppScriptMgr:WaitMilSec(1500)

else

--玩家
CppScriptMgr:NpcCallOut("Is this still the Remote City?\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc185", 150, 430, hero:GetName(), 250, 655)
CppScriptMgr:WaitMilSec(1500)

end

CppScriptMgr:WaitMilSec(2000)

CppScriptMgr:NpcCallOut("The will of the warlords will be revealed here! Are you ready?\n\n\n\n                                     Click ESC to skip the story.", 2000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "", 150, 430, "Mysterious Voice", 250, 1655)

CppScriptMgr:WaitMilSec(2000)


if sex == 1 then 
--玩家
CppScriptMgr:NpcCallOut("Who? Who`s there?\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27064", 150, 430, hero:GetName(), 250, 655)
CppScriptMgr:WaitMilSec(1500)

else

--玩家
CppScriptMgr:NpcCallOut("Who? Who`s there?\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc185", 150, 430, hero:GetName(), 250, 655)
CppScriptMgr:WaitMilSec(1500)

end

-- 场景二



CppScriptMgr:SetViewPosByCell(168,141)

CppScriptMgr:WaitMilSec(1000)

-- 铁拳魔君攻击三名镇远军士兵
playerMonster9:SetAction(401)
CppScriptMgr:WaitMilSec(1000)

playerGuard1:SetAction(330)
playerGuard2:SetAction(330)
playerGuard3:SetAction(330)

CppScriptMgr:WaitMilSec(2500)

playerGuard1:SetPos(1000,1000)
playerGuard2:SetPos(1000,1000)
playerGuard3:SetPos(1000,1000)

local player9  = CppScriptMgr:AddSimplePlayer(10674,164,143, "", 400300009,1);
local player10 = CppScriptMgr:AddSimplePlayer(10674,169,145, "", 400300010,1);
local player11 = CppScriptMgr:AddSimplePlayer(10674,174,143, "", 400300011,1);
local effectObj101  = CppScriptMgr:AddEffect("Blood",164,143)
local effectObj102  = CppScriptMgr:AddEffect("Blood",169,145)
local effectObj103  = CppScriptMgr:AddEffect("Blood",174,143)

CppScriptMgr:WaitMilSec(2000)

local playerGuard4 = CppScriptMgr:AddPlayer(910,156,153, "Peace Defender")
playerGuard4:SetZoomPercent(100)
playerGuard4:SetDir(4)
playerGuard4:Say("For Peace Army!", 5000)

local playerGuard5 = CppScriptMgr:AddPlayer(910,160,156, "Peace Defender")
playerGuard5:SetZoomPercent(100)
playerGuard5:SetDir(4)

local playerGuard6 = CppScriptMgr:AddPlayer(910,168,158, "Peace Defender")
playerGuard6:SetZoomPercent(100)
playerGuard6:SetDir(4)
playerGuard6:Say("Go forward! Comrades!", 5000)

local playerGuard7 = CppScriptMgr:AddPlayer(910,175,156, "Peace Defender")
playerGuard7:SetZoomPercent(100)
playerGuard7:SetDir(4)

local playerGuard8 = CppScriptMgr:AddPlayer(910,181,153, "Peace Defender")
playerGuard8:SetZoomPercent(100)
playerGuard8:SetDir(4)
playerGuard8:Say("For Peace Army!", 5000)

playerGuard4:RunTo(162,139)
playerGuard5:RunTo(165,142)
playerGuard6:RunTo(168,143)
playerGuard7:RunTo(171,143)
playerGuard8:RunTo(174,139)


for i = 0,15 do
	local nPoY = 156 - i
	CppScriptMgr:SetViewPosByCell(169,nPoY)
	CppScriptMgr:WaitMilSec(50)
end

CppScriptMgr:WaitMilSec(2600)
playerGuard4:SetDir(6)
playerGuard8:SetDir(2)
CppScriptMgr:WaitMilSec(800)

playerGuard4:SetAction(404)
playerGuard5:SetAction(404)
playerGuard6:SetAction(404)
playerGuard7:SetAction(404)
playerGuard8:SetAction(404)

-- 铁拳魔君攻击五名镇远军士兵
playerMonster9:SetAction(401)

playerGuard4:SetAction(330)
playerGuard5:SetAction(330)
playerGuard6:SetAction(330)
playerGuard7:SetAction(330)
playerGuard8:SetAction(330)

CppScriptMgr:WaitMilSec(2500)

playerGuard4:SetPos(1000,1000)
playerGuard5:SetPos(1000,1000)
playerGuard6:SetPos(1000,1000)
playerGuard7:SetPos(1000,1000)
playerGuard8:SetPos(1000,1000)

local player12 = CppScriptMgr:AddSimplePlayer(10676,162,139, "", 400300012,1);
local player13 = CppScriptMgr:AddSimplePlayer(10674,165,142, "", 400300013,1);
local player14 = CppScriptMgr:AddSimplePlayer(10674,168,143, "", 400300014,1);
local player15 = CppScriptMgr:AddSimplePlayer(10674,171,143, "", 400300015,1);
local player16 = CppScriptMgr:AddSimplePlayer(10672,174,139, "", 400300016,1);
local effectObj104  = CppScriptMgr:AddEffect("Blood",162,139)
local effectObj105  = CppScriptMgr:AddEffect("Blood",165,142)
local effectObj106  = CppScriptMgr:AddEffect("Blood",168,143)
local effectObj107  = CppScriptMgr:AddEffect("Blood",171,143)
local effectObj108  = CppScriptMgr:AddEffect("Blood",174,139)

CppScriptMgr:WaitMilSec(2000)


playerMonster9:SetAction(470)
--铁拳魔君
CppScriptMgr:NpcCallOut("Is there no one is your army who can fight? Then just die here!\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)

CppScriptMgr:WaitMilSec(2000)

-- 召唤魔将特效
local effectObj31 = CppScriptMgr:AddEffect("zf2-e224",159,148)
local effectObj32 = CppScriptMgr:AddEffect("zf2-e224",169,148)
local effectObj33 = CppScriptMgr:AddEffect("zf2-e224",179,148)


CppScriptMgr:WaitMilSec(500)

local playerMonster10 = CppScriptMgr:AddPlayer(353,159,148, "Abyss Evil Lord")
playerMonster10:SetZoomPercent(150)
playerMonster10:SetDir(0)

local playerMonster11 = CppScriptMgr:AddPlayer(279,169,148, "Bloody Wolf")
playerMonster11:SetZoomPercent(150)
playerMonster11:SetDir(0)

local playerMonster12 = CppScriptMgr:AddPlayer(277,179,148, "Dark Wing Evil")
playerMonster12:SetZoomPercent(150)
playerMonster12:SetDir(0)
CppScriptMgr:WaitMilSec(2000)

CppScriptMgr:ClearEffect(effectObj31)
CppScriptMgr:ClearEffect(effectObj32)
CppScriptMgr:ClearEffect(effectObj33)

-- CppScriptMgr:SetViewPosByCell(168,152)

local playerGuard9 = CppScriptMgr:AddPlayer(910,156,161, "")
playerGuard9:SetZoomPercent(100)
playerGuard9:SetDir(2)

local playerGuard10 = CppScriptMgr:AddPlayer(910,158,159, "")
playerGuard10:SetZoomPercent(100)
playerGuard10:SetDir(0)

local playerGuard11 = CppScriptMgr:AddPlayer(910,161,160, "")
playerGuard11:SetZoomPercent(100)
playerGuard11:SetDir(0)

local playerGuard12 = CppScriptMgr:AddPlayer(910,158,163, "")
playerGuard12:SetZoomPercent(100)
playerGuard12:SetDir(4)

local playerGuard13 = CppScriptMgr:AddPlayer(910,161,164, "")
playerGuard13:SetZoomPercent(100)
playerGuard13:SetDir(4)

local playerMonster21 = CppScriptMgr:AddSimplePlayer(46364,159,161, "");
playerMonster21:SetZoomPercent(100)
playerMonster21:SetDir(0)

local playerGuard14 = CppScriptMgr:AddPlayer(910,165,157, "")
playerGuard14:SetZoomPercent(100)
playerGuard14:SetDir(6)

local playerGuard15 = CppScriptMgr:AddPlayer(910,168,155, "")
playerGuard15:SetZoomPercent(100)
playerGuard15:SetDir(0)

local playerGuard16 = CppScriptMgr:AddPlayer(910,171,157, "")
playerGuard16:SetZoomPercent(100)
playerGuard16:SetDir(2)

local playerGuard17 = CppScriptMgr:AddPlayer(910,167,161, "")
playerGuard17:SetZoomPercent(100)
playerGuard17:SetDir(4)

local playerGuard18 = CppScriptMgr:AddPlayer(910,169,161, "")
playerGuard18:SetZoomPercent(100)
playerGuard18:SetDir(4)

local playerMonster22 = CppScriptMgr:AddSimplePlayer(46364,168,156, "");
playerMonster22:SetZoomPercent(100)
playerMonster22:SetDir(0)

local playerGuard19 = CppScriptMgr:AddPlayer(910,184,161, "")
playerGuard19:SetZoomPercent(100)
playerGuard19:SetDir(2)

local playerGuard20 = CppScriptMgr:AddPlayer(910,183,164, "")
playerGuard20:SetZoomPercent(100)
playerGuard20:SetDir(2)

local playerGuard21 = CppScriptMgr:AddPlayer(910,178,164, "")
playerGuard21:SetZoomPercent(100)
playerGuard21:SetDir(5)

local playerGuard22 = CppScriptMgr:AddPlayer(910,179,166, "")
playerGuard22:SetZoomPercent(100)
playerGuard22:SetDir(4)

local playerGuard23 = CppScriptMgr:AddPlayer(910,182,167, "")
playerGuard23:SetZoomPercent(100)
playerGuard23:SetDir(4)

local playerMonster23 = CppScriptMgr:AddSimplePlayer(46364,181,164, "");
playerMonster23:SetZoomPercent(100)
playerMonster23:SetDir(0)

playerMonster10:RunTo(157,154)
playerMonster11:RunTo(168,151)
playerMonster12:RunTo(180,159)

for i = 0,14 do
	local nPoY = 141 + i
	CppScriptMgr:SetViewPosByCell(168,nPoY)
	CppScriptMgr:WaitMilSec(50)
end



CppScriptMgr:WaitMilSec(1200)
playerMonster10:SetDir(0)
playerMonster11:SetDir(0)
playerMonster12:SetDir(0)


-- 三魔军攻击

playerMonster10:SetAction(404)
playerMonster11:SetAction(404)
playerMonster12:SetAction(404)


playerGuard9 :SetAction(330)
playerGuard10:SetAction(330)
playerGuard11:SetAction(330)
-- playerGuard12:SetAction(330)
-- playerGuard13:SetAction(330)
playerGuard14:SetAction(330)
playerGuard15:SetAction(330)
playerGuard16:SetAction(330)
-- playerGuard17:SetAction(330)
-- playerGuard18:SetAction(330)
playerGuard19:SetAction(330)
playerGuard20:SetAction(330)
playerGuard21:SetAction(330)
-- playerGuard22:SetAction(330)
-- playerGuard23:SetAction(330)


CppScriptMgr:WaitMilSec(2500)

playerGuard9 :SetPos(1000,1000)
playerGuard10:SetPos(1000,1000)
playerGuard11:SetPos(1000,1000)
-- playerGuard12:SetPos(1000,1000)
-- playerGuard13:SetPos(1000,1000)
playerGuard14:SetPos(1000,1000)
playerGuard15:SetPos(1000,1000)
playerGuard16:SetPos(1000,1000)
-- playerGuard17:SetPos(1000,1000)
-- playerGuard18:SetPos(1000,1000)
playerGuard19:SetPos(1000,1000)
playerGuard20:SetPos(1000,1000)
playerGuard21:SetPos(1000,1000)
-- playerGuard22:SetPos(1000,1000)
-- playerGuard23:SetPos(1000,1000)

local player17 = CppScriptMgr:AddSimplePlayer(10672,156,161, "", 400300017,1);
local player18 = CppScriptMgr:AddSimplePlayer(10670,158,159, "", 400300018,1);
local player19 = CppScriptMgr:AddSimplePlayer(10670,161,160, "", 400300019,1);
-- local player20 = CppScriptMgr:AddSimplePlayer(10674,157,155, "镇远军将士的尸体", 400300020,1);
-- local player21 = CppScriptMgr:AddSimplePlayer(10674,159,155, "镇远军将士的尸体", 400300021,1);
local player22 = CppScriptMgr:AddSimplePlayer(10676,165,157, "", 400300022,1);
local player23 = CppScriptMgr:AddSimplePlayer(10670,168,155, "", 400300023,1);
local player24 = CppScriptMgr:AddSimplePlayer(10672,171,157, "", 400300024,1);
-- local player25 = CppScriptMgr:AddSimplePlayer(10674,167,155, "镇远军将士的尸体", 400300025,1);
-- local player26 = CppScriptMgr:AddSimplePlayer(10674,169,155, "镇远军将士的尸体", 400300026,1);
local player27 = CppScriptMgr:AddSimplePlayer(10672,184,161, "", 400300027,1);
local player28 = CppScriptMgr:AddSimplePlayer(10672,183,164, "", 400300028,1);
local player29 = CppScriptMgr:AddSimplePlayer(10675,178,164, "", 400300029,1);
-- local player30 = CppScriptMgr:AddSimplePlayer(10674,177,155, "镇远军将士的尸体", 400300030,1);
-- local player31 = CppScriptMgr:AddSimplePlayer(10674,179,155, "镇远军将士的尸体", 400300031,1);

playerGuard12:SetAction(404)
playerGuard13:SetAction(404)

playerGuard17:SetAction(404)
playerGuard18:SetAction(404)

playerGuard22:SetAction(404)
playerGuard23:SetAction(404)

local effectObj110  = CppScriptMgr:AddEffect("Blood",156,161)
local effectObj111  = CppScriptMgr:AddEffect("Blood",158,159)
local effectObj112  = CppScriptMgr:AddEffect("Blood",161,160)

local effectObj113  = CppScriptMgr:AddEffect("Blood",165,157)
local effectObj114  = CppScriptMgr:AddEffect("Blood",168,155)
local effectObj115  = CppScriptMgr:AddEffect("Blood",171,157)

local effectObj116  = CppScriptMgr:AddEffect("Blood",184,161)
local effectObj117  = CppScriptMgr:AddEffect("Blood",183,164)
local effectObj118  = CppScriptMgr:AddEffect("Blood",178,164)
-- player23:Say("萧，萧将军。。。", 5000)


CppScriptMgr:WaitMilSec(3000)

CppScriptMgr:SetViewPosByCell(168,170)

local effectObj4 = CppScriptMgr:AddEffect("zf2-e281",159,175)
local effectObj5 = CppScriptMgr:AddEffect("zf2-e281",169,175)
local effectObj6 = CppScriptMgr:AddEffect("zf2-e281",179,175)
CppScriptMgr:WaitMilSec(500)

-- 生成三大将领
local player31 = CppScriptMgr:AddSimplePlayer(1056734,159,175, "Zheng Dongjiang", 400300031,1);
player31:SetZoomPercent(110)
player31:SetArmor(187465,0,1)
player31:SetRWeapon(410389,0,1)
player31:SetLWeapon(900309,0,1)
player31:SetDir(4)
local player32 = CppScriptMgr:AddSimplePlayer(1056734,169,175, "Han Jingzhong", 400300032,1);
player32:SetZoomPercent(110)
player32:SetArmor(189075,0,1)
player32:SetRWeapon(450329,0,1)
player32:SetLWeapon(450329,0,1)
player32:SetDir(4)
local player33 = CppScriptMgr:AddSimplePlayer(1056734,179,175, "Xue Wenzong", 400300033,1);
player33:SetZoomPercent(110)
player33:SetArmor(187505,0,1)
player33:SetRWeapon(420389,0,1)
player33:SetLWeapon(420389,0,1)
player33:SetDir(4)


CppScriptMgr:WaitMilSec(1500)

CppScriptMgr:ClearEffect(effectObj4)
CppScriptMgr:ClearEffect(effectObj5)
CppScriptMgr:ClearEffect(effectObj6)

CppScriptMgr:WaitMilSec(500)

player31:RunTo(157,157)
player32:RunTo(168,154)
player33:RunTo(180,162)

for i = 0,15 do
	local nPoY = 170 - i
	CppScriptMgr:SetViewPosByCell(168,nPoY)
	CppScriptMgr:WaitMilSec(50)
end


CppScriptMgr:WaitMilSec(2500)

playerMonster10:SetAction(404)
playerMonster11:SetAction(404)
playerMonster12:SetAction(404)

player31:SetAction(404)
player32:SetAction(404)
player33:SetAction(404)

CppScriptMgr:WaitMilSec(3000)
CppScriptMgr:NpcCallOut("How dare you offend our City? 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)
local effectObj9  = CppScriptMgr:AddEffect("zsl_rwzy",157,154)
local effectObj10 = CppScriptMgr:AddEffect("zsl_rwzy",168,152)
local effectObj11 = CppScriptMgr:AddEffect("zsl_rwzy",180,160)

CppScriptMgr:WaitMilSec(2000)

CppScriptMgr:ClearEffect(effectObj9)
CppScriptMgr:ClearEffect(effectObj10)
CppScriptMgr:ClearEffect(effectObj11)

local effectObj12 = CppScriptMgr:AddEffect("5fire",157,154)
local effectObj13 = CppScriptMgr:AddEffect("5fire",168,152)
local effectObj14 = CppScriptMgr:AddEffect("5fire",180,160)

CppScriptMgr:WaitMilSec(1000)

playerMonster10:SetAction(330)
playerMonster11:SetAction(330)
playerMonster12:SetAction(330)


--移走三大魔将
CppScriptMgr:WaitMilSec(1000)
playerMonster11:SetPos(1000,1000)
CppScriptMgr:WaitMilSec(1000)
playerMonster10:SetPos(1000,1000)

playerMonster12:SetPos(1000,1000)

CppScriptMgr:SetViewPosByCell(168,170)
-- 生成萧无定
local player34 = CppScriptMgr:AddSimplePlayer(1056744,168,190, "General Xiao", 400300034,1);
player34:SetZoomPercent(130)
-- player34:SetArmor(196485,0,1)
-- player34:SetArmet(111309,0,1)
-- player34:SetHair(95,1)
-- player34:SetRWeapon(560900,0,1)
-- player34:SetLWeapon(560900,0,1)
player34:SetDir(4)


local effectObj41 = CppScriptMgr:AddEffect("windupatt907",164,185);
local effectObj42 = CppScriptMgr:AddEffect("windupatt907",167,185);
local effectObj43 = CppScriptMgr:AddEffect("windupatt907",171,185);
local effectObj44 = CppScriptMgr:AddEffect("windupatt907",175,185);
local effectObj45 = CppScriptMgr:AddEffect("windupatt907",171,189);

player34:RunTo(168,166)

local effectObj51 = CppScriptMgr:AddEffect("windupatt907",164,185);
local effectObj52 = CppScriptMgr:AddEffect("windupatt907",167,185);
local effectObj53 = CppScriptMgr:AddEffect("windupatt907",171,185);
local effectObj54 = CppScriptMgr:AddEffect("windupatt907",175,185);
local effectObj55 = CppScriptMgr:AddEffect("windupatt907",171,189);

CppScriptMgr:WaitMilSec(500)
local effectObj61 = CppScriptMgr:AddEffect("windupatt907",164,185);
local effectObj62 = CppScriptMgr:AddEffect("windupatt907",167,185);
local effectObj63 = CppScriptMgr:AddEffect("windupatt907",171,185);
local effectObj64 = CppScriptMgr:AddEffect("windupatt907",175,185);
local effectObj65 = CppScriptMgr:AddEffect("windupatt907",171,189);
CppScriptMgr:WaitMilSec(500)
local effectObj71 = CppScriptMgr:AddEffect("windupatt907",164,185);
local effectObj72 = CppScriptMgr:AddEffect("windupatt907",167,185);
local effectObj73 = CppScriptMgr:AddEffect("windupatt907",171,185);
local effectObj74 = CppScriptMgr:AddEffect("windupatt907",175,185);
local effectObj75 = CppScriptMgr:AddEffect("windupatt907",171,189);
CppScriptMgr:WaitMilSec(500)
for i = 0,7 do
	local nPoY = 170 - i
	CppScriptMgr:SetViewPosByCell(168,nPoY)
	CppScriptMgr:WaitMilSec(50)
end

CppScriptMgr:WaitMilSec(3500)
-- local playerGuard24 = CppScriptMgr:AddPlayer(910,156,163, "镇远城卫兵")
-- playerGuard24:SetZoomPercent(100)
-- playerGuard24:SetDir(4)
playerGuard12:Say("General Xiao is back! We shall be saved!", 5000)

-- local playerGuard25 = CppScriptMgr:AddPlayer(910,181,162, "镇远城卫兵")
-- playerGuard25:SetZoomPercent(100)
-- playerGuard25:SetDir(4)
playerGuard17:Say("For the glory of Peace Army!", 5000)

-- local playerGuard26 = CppScriptMgr:AddPlayer(910,171,156, "镇远城卫兵")
-- playerGuard26:SetZoomPercent(100)
-- playerGuard26:SetDir(4)
playerGuard22:Say("Go! Comrades! For General Xiao!", 5000)

CppScriptMgr:NpcCallOut("We fall, we break, we fail... But then, we rise, we heal, we overcome!\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(3000)
