------------------------------------------------------------------------------------
--Name:			210804[简体征服][活动脚本]全球中秋节活动--玉锦阁
--Creator:		洪聪敏
--Created:		2021/08/04
------------------------------------------------------------------------------------
--/callluafunc </F>User_PlayPlot</N>208
--/reloadlua Script/MidAutumnMaze.lua.lua

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

CppScriptMgr:SetLightScreen(2000);

--创建玩家
local player1 = CppScriptMgr:AddSimplePlayer(1057284, 50,52, "Glow Fairy", 400300001,1);
player1:SetZoomPercent(120);
player1:SetDir(4);


local hero = CppScriptMgr:QueryHero();
hero:SetZoomPercent(100)
hero:SetPos(49,47)
hero:SetDir(0)

player1:Say("There are countless traps in Jade Attic. You must kill 20 Jade Beasts within 2 minutes and dodge the traps at the same time.",2000);
CppScriptMgr:WaitMilSec(3000);

player1:SetAction(200)
player1:Say("Are you ready?",1500);
CppScriptMgr:WaitMilSec(2000);

hero:SetAction(230)
hero:Say("Yes!", 1500);
CppScriptMgr:WaitMilSec(2000);

player1:SetPos(1,1)

local effectObj1 = CppScriptMgr:AddEffect("twz_qxz_xg",50,47);
local effectObj2 = CppScriptMgr:AddEffect("twz_qxz_xg",50,47);
CppScriptMgr:WaitMilSec(2000);
CppScriptMgr:NpcCallOut("     Warning! The traps will be activated in 5 seconds!\\n\n\n\n                                     Press ESC to skip the story.", 3000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27641", 150, 430, "Glow Fairy", 250, 655);
CppScriptMgr:WaitMilSec(2000);

local effectObj3 = CppScriptMgr:AddEffect("twz_twj_fwsh",50,47);
hero:SetAction(310)


CppScriptMgr:WaitMilSec(2000);
CppScriptMgr:NpcCallOut("     You`ll be badly injured if you`re hit by the traps. You can only take the damage up to 3 times.\n\n\n\n                                     Press ESC to skip the story.", 3000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27641", 150, 430, "Glow Fairy", 250, 655);
CppScriptMgr:WaitMilSec(2000);

hero:JumpTo(50,54);
local effectObj4 = CppScriptMgr:AddEffect("twz_qxz_xg",46,50);
local effectObj5 = CppScriptMgr:AddEffect("twz_qxz_xg",50,54);
local effectObj6 = CppScriptMgr:AddEffect("twz_qxz_xg",53,50);
CppScriptMgr:WaitMilSec(1000);
CppScriptMgr:NpcCallOut("     Warning! The next wave of traps will be activated in 5 seconds!\n\n\n\n                                     Press ESC to skip the story.", 3000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27641", 150, 430, "Glow Fairy", 250, 655);
CppScriptMgr:WaitMilSec(2000);

local effectObj7 = CppScriptMgr:AddEffect("thunder2-7",46,50);
local effectObj8 = CppScriptMgr:AddEffect("thunder2-7",50,54);
local effectObj9 = CppScriptMgr:AddEffect("thunder2-7",53,50);
hero:SetAction(310)

CppScriptMgr:WaitMilSec(2000);
CppScriptMgr:NpcCallOut("     You`ll be badly injured if you`re hit by the traps. You can only take the damage up to 3 times.\n\n\n\n                                     Press ESC to skip the story.", 3000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27641", 150, 430, "Glow Fairy", 250, 655);
CppScriptMgr:WaitMilSec(2000);


hero:JumpTo(59,50);
CppScriptMgr:SetViewPosByCell(59,50)
local effectObj10 = CppScriptMgr:AddEffect("twz_qxz_xg",46,50);
local effectObj11 = CppScriptMgr:AddEffect("twz_qxz_xg",50,54);
local effectObj12 = CppScriptMgr:AddEffect("twz_qxz_xg",53,50);
local effectObj12 = CppScriptMgr:AddEffect("twz_qxz_xg",50,47);
CppScriptMgr:WaitMilSec(1000);
CppScriptMgr:NpcCallOut("     Warning! The next wave of traps will be activated in 5 seconds!\n\n\n\n                                     Press ESC to skip the story.", 3000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27641", 150, 430, "Glow Fairy", 250, 655);
CppScriptMgr:WaitMilSec(2000);

--怪物
local playerMonster1 = CppScriptMgr:AddPlayer(334,43,53, "Jade Beast")
playerMonster1:Say("Attack!",3000)
playerMonster1:SetZoomPercent(70)
playerMonster1:SetDir(0)

local playerMonster2 = CppScriptMgr:AddPlayer(334,55,56, "Jade Beast")
playerMonster2:Say("Attack!", 3000)
playerMonster2:SetZoomPercent(70)
playerMonster2:SetDir(0)

local playerMonster3 = CppScriptMgr:AddPlayer(334,55,44, "Jade Beast")
playerMonster3:Say("Attack!", 3000)
playerMonster3:SetZoomPercent(70)
playerMonster3:SetDir(0)

local playerMonster4 = CppScriptMgr:AddPlayer(334,43,43, "Jade Beast")
playerMonster4:Say("Attack!",3000)
playerMonster4:SetZoomPercent(70)
playerMonster4:SetDir(0)
CppScriptMgr:WaitMilSec(2000);





local effectObj7 = CppScriptMgr:AddEffect("thunder1",46,50);
local effectObj8 = CppScriptMgr:AddEffect("thunder1",50,54);
local effectObj9 = CppScriptMgr:AddEffect("thunder1",53,50);
CppScriptMgr:WaitMilSec(1000);
CppScriptMgr:NpcCallOut("     You`ll be burned if you step on the the flames. You can only take the damage up to 3 times. Hurry up and kill those Jade Beasts!\n\n\n\n                                     Press ESC to skip the story.", 3000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc27641", 150, 430, "Glow Fairy", 250, 655);
CppScriptMgr:WaitMilSec(2000);

hero:JumpTo(53,50);
CppScriptMgr:SetViewPosByCell(52, 52)
CppScriptMgr:WaitMilSec(1000)
hero:SetAction(905)
hero:SetDir(6)
--地震
CppScriptMgr:AddEffect("fathitgtsyd",52,52)
CppScriptMgr:WaitMilSec(2000)
--怪物死亡
playerMonster1:SetAction(330)
playerMonster2:SetAction(330)
playerMonster3:SetAction(330)
playerMonster4:SetAction(330)
CppScriptMgr:WaitMilSec(2500)
--怪物移走
playerMonster1:SetPos(1,1)
playerMonster2:SetPos(1,1)
playerMonster3:SetPos(1,1)
playerMonster4:SetPos(1,1)
CppScriptMgr:WaitMilSec(1000)

CppScriptMgr:AddEffect("zf2-e123",50,52)
CppScriptMgr:AddEffect("zf2-e123",50,52)
CppScriptMgr:AddEffect("zf2-e123",50,52)
player1:SetPos(50,52)
hero:SetDir(0)

player1:Say("Congrats! You`ve passed my trial!",1500);
CppScriptMgr:WaitMilSec(2000);

hero:Say("Easy peasy!", 1500);
CppScriptMgr:WaitMilSec(2000);

