------------------------------------------------------------------------------------
--Name:  	201111[简体征服][任务脚本]战士觉醒任务-大漠取泉水
--Creator:	冯子鑫
--Created:	2020-11-11
------------------------------------------------------------------------------------
--/callluafunc </F>User_PlayPlot</N>94


-- 设置摄像机指向位置(网格坐标)
CppScriptMgr:SetViewPosByCell(228,397)
------------------------------------------------------------
--玩家对象操作接口,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:SetRWeapon(0,0,1)
hero:SetLWeapon(0,0,1)

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

local Boss = CppScriptMgr:AddPlayer(146,228,390, "Iron Fist")
Boss:SetZoomPercent(150)
Boss:SetDir(0)

local soldier1  = CppScriptMgr:AddSimplePlayer(10670,224,395, "")
local soldier2  = CppScriptMgr:AddSimplePlayer(10670,218,390, "")
local soldier3  = CppScriptMgr:AddSimplePlayer(10671,224,388, "")
local soldier4  = CppScriptMgr:AddSimplePlayer(10673,232,395, "")
local soldier5  = CppScriptMgr:AddSimplePlayer(10672,221,399, "")
local soldier6  = CppScriptMgr:AddSimplePlayer(10676,224,403, "")
local soldier7  = CppScriptMgr:AddSimplePlayer(10676,229,403, "")
local soldier8  = CppScriptMgr:AddSimplePlayer(10677,235,408, "")
local soldier9  = CppScriptMgr:AddSimplePlayer(10671,216,395, "")
local soldier10 = CppScriptMgr:AddSimplePlayer(10673,214,401, "")
local soldier11 = CppScriptMgr:AddSimplePlayer(10676,219,405, "")
local soldier12 = CppScriptMgr:AddSimplePlayer(10676,235,402, "")
local soldier13 = CppScriptMgr:AddSimplePlayer(10672,234,389, "")
local soldier14 = CppScriptMgr:AddSimplePlayer(10673,242,406, "")
local effectObj101 = CppScriptMgr:AddEffect("Blood_999",224,395)
local effectObj102 = CppScriptMgr:AddEffect("Blood_999",218,390)
local effectObj103 = CppScriptMgr:AddEffect("Blood_999",224,388)
local effectObj104 = CppScriptMgr:AddEffect("Blood_999",232,395)
local effectObj105 = CppScriptMgr:AddEffect("Blood_999",221,399)
local effectObj106 = CppScriptMgr:AddEffect("Blood_999",224,403)
local effectObj107 = CppScriptMgr:AddEffect("Blood_999",229,403)
local effectObj108 = CppScriptMgr:AddEffect("Blood_999",235,408)
local effectObj109 = CppScriptMgr:AddEffect("Blood_999",216,395)
local effectObj110 = CppScriptMgr:AddEffect("Blood_999",214,401)
local effectObj111 = CppScriptMgr:AddEffect("Blood_999",219,405)
local effectObj112 = CppScriptMgr:AddEffect("Blood_999",235,402)
local effectObj113 = CppScriptMgr:AddEffect("Blood_999",234,389)
local effectObj114 = CppScriptMgr:AddEffect("Blood_999",242,406)


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

CppScriptMgr:NpcCallOut("You can`t believe what`s in front of you. All the soldiers from Peace Army have been killed!\n\n\n\n                                     Click ESC to skip the story.", 2500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "", 150, 430, "Mysterious Voice", 250, 1655)
CppScriptMgr:WaitMilSec(2500)

hero:Say("Is it an illusion, or reality?",3000)

CppScriptMgr:WaitMilSec(3000)

--玩家
CppScriptMgr:NpcCallOut("No! It`s not possible!\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("Hahaha! Your blood will be our path to glory!\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)

CppScriptMgr:WaitMilSec(2000)

--铁拳魔君
CppScriptMgr:NpcCallOut("Come and be my servant!\n\n\n\n                                     Click ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc7126", 150, 430, "Iron Fist", 250, 655)
CppScriptMgr:WaitMilSec(1500)
Boss:SetAction(404)

local effectObj1 = CppScriptMgr:AddEffect("zf2-e224",227,399)
effectObj1:Scale( 2, 2, 2)

CppScriptMgr:SetDarkScreen(1000)
CppScriptMgr:WaitMilSec(1000)



soldier1:SetPos(1000,1000)
soldier2:SetPos(1000,1000)
soldier3:SetPos(1000,1000)
soldier4:SetPos(1000,1000)
soldier5:SetPos(1000,1000)

local playerGuard1 = CppScriptMgr:AddPlayer(265,224,395, "Demonized Soldier")
playerGuard1:SetZoomPercent(100)
playerGuard1:SetDir(0)

local playerGuard2 = CppScriptMgr:AddPlayer(265,218,390, "Demonized Soldier")
playerGuard2:SetZoomPercent(100)
playerGuard2:SetDir(0)

local playerGuard3 = CppScriptMgr:AddPlayer(265,224,388, "Demonized Soldier")
playerGuard3:SetZoomPercent(100)
playerGuard3:SetDir(0)

local playerGuard4 = CppScriptMgr:AddPlayer(265,232,395, "Demonized Soldier")
playerGuard4:SetZoomPercent(100)
playerGuard4:SetDir(0)

local playerGuard5 = CppScriptMgr:AddPlayer(265,221,399, "Demonized Soldier")
playerGuard5:SetZoomPercent(100)
playerGuard5:SetDir(0)

CppScriptMgr:ClearEffect(effectObj101)
CppScriptMgr:ClearEffect(effectObj102)
CppScriptMgr:ClearEffect(effectObj103)
CppScriptMgr:ClearEffect(effectObj104)
CppScriptMgr:ClearEffect(effectObj105)
CppScriptMgr:SetLightScreen(1000)
CppScriptMgr:WaitMilSec(1000)


local effectObj2 = CppScriptMgr:AddEffect("zf2-e224",227,399)
effectObj2:Scale( 2, 2, 2)

CppScriptMgr:SetDarkScreen(1000)
CppScriptMgr:WaitMilSec(1000)



soldier6 :SetPos(1000,1000)
soldier7 :SetPos(1000,1000)
soldier8 :SetPos(1000,1000)
soldier9 :SetPos(1000,1000)
soldier10:SetPos(1000,1000)

local playerGuard6 = CppScriptMgr:AddPlayer(265,224,403, "Demonized Soldier")
playerGuard6:SetZoomPercent(100)
playerGuard6:SetDir(0)

local playerGuard7 = CppScriptMgr:AddPlayer(265,229,403, "Demonized Soldier")
playerGuard7:SetZoomPercent(100)
playerGuard7:SetDir(0)

local playerGuard8 = CppScriptMgr:AddPlayer(265,235,408, "Demonized Soldier")
playerGuard8:SetZoomPercent(100)
playerGuard8:SetDir(0)

local playerGuard9 = CppScriptMgr:AddPlayer(265,216,395, "Demonized Soldier")
playerGuard9:SetZoomPercent(100)
playerGuard9:SetDir(0)

local playerGuard10 = CppScriptMgr:AddPlayer(265,214,401, "Demonized Soldier")
playerGuard10:SetZoomPercent(100)
playerGuard10:SetDir(0)

CppScriptMgr:ClearEffect(effectObj106)
CppScriptMgr:ClearEffect(effectObj107)
CppScriptMgr:ClearEffect(effectObj108)
CppScriptMgr:ClearEffect(effectObj109)
CppScriptMgr:ClearEffect(effectObj110)
CppScriptMgr:SetLightScreen(1000)
CppScriptMgr:WaitMilSec(1000)

CppScriptMgr:SetDarkScreen(1000)
CppScriptMgr:WaitMilSec(1000)



soldier11:SetPos(1000,1000)
soldier12:SetPos(1000,1000)
soldier13:SetPos(1000,1000)
soldier14:SetPos(1000,1000)


local playerGuard11 = CppScriptMgr:AddPlayer(265,219,405, "Demonized Soldier")
playerGuard11:SetZoomPercent(100)
playerGuard11:SetDir(0)

local playerGuard12 = CppScriptMgr:AddPlayer(265,235,402, "Demonized Soldier")
playerGuard12:SetZoomPercent(100)
playerGuard12:SetDir(0)

local playerGuard13 = CppScriptMgr:AddPlayer(265,234,389, "Demonized Soldier")
playerGuard13:SetZoomPercent(100)
playerGuard13:SetDir(0)

local playerGuard14 = CppScriptMgr:AddPlayer(265,242,406, "Demonized Soldier")
playerGuard14:SetZoomPercent(100)
playerGuard14:SetDir(0)

CppScriptMgr:ClearEffect(effectObj111)
CppScriptMgr:ClearEffect(effectObj112)
CppScriptMgr:ClearEffect(effectObj113)
CppScriptMgr:ClearEffect(effectObj114)

CppScriptMgr:SetLightScreen(1000)
CppScriptMgr:WaitMilSec(1000)

CppScriptMgr:ClearEffect(effectObj1)
CppScriptMgr:ClearEffect(effectObj2)




CppScriptMgr:WaitMilSec(1000)

--玩家
CppScriptMgr:NpcCallOut("I failed to save the Peace Army!\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("The bloody flowers are the best gift to Demon King!\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)


playerGuard1 :WalkTo(228,405)
playerGuard2 :WalkTo(225,403)
playerGuard3 :WalkTo(228,403)
playerGuard4 :WalkTo(230,406)
playerGuard5 :WalkTo(224,405)
playerGuard6 :WalkTo(226,408)
playerGuard7 :WalkTo(229,408)
playerGuard8 :WalkTo(231,411)
playerGuard9 :WalkTo(222,402)
playerGuard10:WalkTo(221,407)
playerGuard11:WalkTo(225,410)
playerGuard12:WalkTo(231,408)
playerGuard13:WalkTo(230,404)
playerGuard14:WalkTo(232,409)

-- 228 397 - 228 402 
for i = 0,5 do
	local nPoX = 228
	local nPoY = 397 + i
	CppScriptMgr:SetViewPosByCell(nPoX,nPoY)
	CppScriptMgr:WaitMilSec(80)
end

CppScriptMgr:WaitMilSec(1520)

playerGuard6 :SetAction(404)
playerGuard7 :SetAction(404)
playerGuard8 :SetAction(404)
playerGuard11:SetAction(404)

hero:JumpTo(228,416)
CppScriptMgr:WaitMilSec(100)
hero:SetDir(4)
CppScriptMgr:WaitMilSec(1000)
hero:SetAction(220)

--玩家
CppScriptMgr:NpcCallOut("The Peace Army is gone? No!\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(500)
hero:SetAction(220)
CppScriptMgr:WaitMilSec(500)
hero:SetAction(220)
CppScriptMgr:WaitMilSec(500)
hero:SetAction(220)
CppScriptMgr:WaitMilSec(500)
hero:SetAction(220)
CppScriptMgr:WaitMilSec(500)
hero:SetAction(220)
CppScriptMgr:WaitMilSec(500)
hero:SetAction(220)

CppScriptMgr:NpcCallOut("The will of the warlords will not let you surrender! Stand up!\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(500)
hero:SetAction(220)
CppScriptMgr:WaitMilSec(500)
hero:SetAction(220)
CppScriptMgr:WaitMilSec(500)
hero:SetAction(220)
CppScriptMgr:WaitMilSec(500)
hero:SetAction(220)




CppScriptMgr:SetDarkScreen(3000)
CppScriptMgr:WaitMilSec(3000)

CppScriptMgr:SetViewPosByCell(260,448)
local hero2 = CppScriptMgr:QueryHero()

hero2:SetPos(260,448)
hero2:SetDir(4)

local SpringWater = CppScriptMgr:AddPlayer(46250,259,444, "Spring Mouth")
SpringWater:AddEffect("zf2-e181")

CppScriptMgr:SetLightScreen(3000)

CppScriptMgr:WaitMilSec(3000)
--玩家
CppScriptMgr:NpcCallOut("This spring is horrible! Thanks to that voice.\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(2500)










