------------------------------------------------------------------------------------
--Name：     210207[简体征服][活动脚本]全球愚人节活动-剧情引导
--Creator:      冯子鑫
--Created:     2021-02-07
------------------------------------------------------------------------------------
--/callluafunc </F>User_PlayPlot</N>123


-- 设置摄像机指向位置(网格坐标)
CppScriptMgr:SetViewPosByCell(47,44)

------------------------------------------------------------
--玩家对象操作接口,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(48,48)
hero:SetDir(4)
hero:SetRWeapon(0,0,1)
hero:SetLWeapon(0,0,1)

local JOKER  = CppScriptMgr:AddSimplePlayer(1059200,48,37,"JOKER")
JOKER:SetDir(0)
JOKER:SetZoomPercent(120)

local Box1 = CppScriptMgr:AddSimplePlayer(19677,42,40,"MagicCardBox")
local Box2 = CppScriptMgr:AddSimplePlayer(19677,42,46,"MagicCardBox")
local Box3 = CppScriptMgr:AddSimplePlayer(19677,42,52,"MagicCardBox")
local Box4 = CppScriptMgr:AddSimplePlayer(19677,54,43,"MagicCardBox")
local Box5 = CppScriptMgr:AddSimplePlayer(19677,54,50,"MagicCardBox")
Box1:SetZoomPercent(50)
Box2:SetZoomPercent(50)
Box3:SetZoomPercent(50)
Box4:SetZoomPercent(50)
Box5:SetZoomPercent(50)
-- Box1:AddEffect("paibei1")
-- Box2:AddEffect("paibei2")
-- Box3:AddEffect("paibei3")
-- Box4:AddEffect("paibei4")
-- Box5:AddEffect("paibei5")


-- 玩家传送进入副本
local effectObj1 = CppScriptMgr:AddEffect("accession6",48,48)
CppScriptMgr:WaitMilSec(2000)

CppScriptMgr:NpcCallOut("Welcome to Card House! Open the box and complete the quest to get Magic Cards!\n\n\n\n                                     Press ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_Magician", 150, 430, "Card Magician", 250, 655)
CppScriptMgr:WaitMilSec(1500)

--开启跳舞魔盒
hero:WalkTo(47,54)
CppScriptMgr:WaitMilSec(1500)
hero:SetDir(2)

hero:SetAction(210)
CppScriptMgr:WaitMilSec(1000)
Box3:SetPos(10,10)
Box32 = CppScriptMgr:AddSimplePlayer(19687,42,52,"MagicCardBox")
Box32:SetZoomPercent(50)
-- Box32:AddEffect("paibei3")
Box32:AddEffect("pokebaoxiang")
CppScriptMgr:WaitMilSec(1000)

--跳舞
hero:SetAction(5)
JOKER:Say("The Dancing Box will make you dance!", 2000)
hero:Say("Let`s dance! For every second of our life!", 2000)
CppScriptMgr:WaitMilSec(2500)
Box32:SetPos(10,10)
-- Box33 = CppScriptMgr:AddSimplePlayer(19697,171,154,"MagicCardBox")
-- Box33:SetZoomPercent(50)
-- Box33:AddEffect("pokedakai")
-- Box33:AddEffect("en_heitK")
local boxeffectObj1_1  = CppScriptMgr:AddEffect("pokedakai",42,52)
local boxeffectObj1_2  = CppScriptMgr:AddEffect("en_heitK",42,52)
CppScriptMgr:WaitMilSec(500)

--开启小丑魔盒
hero:WalkTo(51,51)
CppScriptMgr:WaitMilSec(1800)
hero:SetDir(6)

hero:SetAction(210)
CppScriptMgr:WaitMilSec(1000)
Box5:SetPos(10,10)
Box52 = CppScriptMgr:AddSimplePlayer(19687,54,50,"MagicCardBox")
Box52:SetZoomPercent(50)
-- Box52:AddEffect("paibei5")
Box52:AddEffect("pokebaoxiang")
CppScriptMgr:WaitMilSec(1000)

--变小丑
hero:SetPos(10,10)
local Clown = CppScriptMgr:AddPlayer(302,51,51,hero:GetName())
Clown:SetDir(6)
JOKER:Say("Clown Box turned you into a Funny Clown!", 2000)
Clown:Say("No! What a clown I am!", 2000)
CppScriptMgr:WaitMilSec(3000)
Clown:SetPos(10,10)
hero:SetPos(51,51)
Box52:SetPos(10,10)
-- Box53 = CppScriptMgr:AddSimplePlayer(19697,183,152,"MagicCardBox")
-- Box53:SetZoomPercent(50)
-- Box53:AddEffect("pokedakai")
-- Box53:AddEffect("en_heitA")
local boxeffectObj2_1  = CppScriptMgr:AddEffect("pokedakai",54,50)
local boxeffectObj2_2  = CppScriptMgr:AddEffect("en_heitA",54,50)
CppScriptMgr:WaitMilSec(500)



--开启变装魔盒
hero:WalkTo(48,47)
CppScriptMgr:WaitMilSec(1800)
hero:SetDir(2)

hero:SetAction(210)
CppScriptMgr:WaitMilSec(1000)
Box2:AddEffect("role-select6")
Box2:SetPos(10,10)
Box22 = CppScriptMgr:AddSimplePlayer(19687,42,46,"MagicCardBox")
Box22:SetZoomPercent(50)
-- Box22:AddEffect("paibei2")
Box22:AddEffect("pokebaoxiang")
CppScriptMgr:WaitMilSec(1000)

--生成骚扰怪
local Swordsman = CppScriptMgr:AddPlayer(353,45,47,"BlueElf")
JOKER:Say("Monsters may jump out of the box!", 2000)
Box2:AddEffect("MBStandard")
Swordsman:SetDir(6)
hero:Say("！", 1000)
hero:JumpTo(49,47)
CppScriptMgr:WaitMilSec(500)
hero:SetDir(2)
hero:SetAction(401)
CppScriptMgr:WaitMilSec(500)
Swordsman:SetAction(330)
hero:Say("This little thing looks so weird.", 2000)
CppScriptMgr:WaitMilSec(1500)
Swordsman:SetPos(10,10)
Box22:SetPos(10,10)
-- Box23 = CppScriptMgr:AddSimplePlayer(19697,171,148,"MagicCardBox")
-- Box23:SetZoomPercent(50)
-- Box23:AddEffect("pokedakai")
-- Box23:AddEffect("en_heit10")
local boxeffectObj3_1  = CppScriptMgr:AddEffect("pokedakai",42,46)
local boxeffectObj3_2  = CppScriptMgr:AddEffect("en_heit10",42,46)
CppScriptMgr:WaitMilSec(500)



--开启冰冻魔盒
hero:WalkTo(51,44)
CppScriptMgr:WaitMilSec(1800)
hero:SetDir(6)

hero:SetAction(210)
CppScriptMgr:WaitMilSec(1000)
Box4:SetPos(10,10)
Box42 = CppScriptMgr:AddSimplePlayer(19687,54,43,"MagicCardBox")
Box42:SetZoomPercent(50)
-- Box42:AddEffect("paibei4")
Box42:AddEffect("pokebaoxiang")
CppScriptMgr:WaitMilSec(1000)

--冰冻
hero:AddEffect("frost_app")
JOKER:Say("The Freezing Box will turn you into a popsicle!", 2000)
CppScriptMgr:WaitMilSec(3000)
hero:DelEffect("frost_app")
hero:Say("(dithering) A bit cold...", 2000)
Box42:SetPos(10,10)
-- Box43 = CppScriptMgr:AddSimplePlayer(19697,183,145,"MagicCardBox")
-- Box43:SetZoomPercent(50)
-- Box43:AddEffect("pokedakai")
-- Box43:AddEffect("en_heitJ")
local boxeffectObj4_1  = CppScriptMgr:AddEffect("pokedakai",54,43)
local boxeffectObj4_2  = CppScriptMgr:AddEffect("en_heitJ",54,43)
CppScriptMgr:WaitMilSec(500)


--开启火焰魔盒
hero:WalkTo(47,42)
CppScriptMgr:WaitMilSec(1800)
hero:SetDir(2)

hero:SetAction(210)
CppScriptMgr:WaitMilSec(1000)
Box1:SetPos(10,10)
Box12 = CppScriptMgr:AddSimplePlayer(19687,42,40,"MagicCardBox")
Box12:SetZoomPercent(50)
-- Box12:AddEffect("paibei1")
Box12:AddEffect("pokebaoxiang")
CppScriptMgr:WaitMilSec(1000)

--火焰
hero:AddEffect("fire-bomb")
JOKER:Say("Burn, Flame Box!", 2000)
CppScriptMgr:WaitMilSec(2000)
hero:DelEffect("fp-lt")
hero:Say("That`s it? I can`t feel anything!", 2000)
Box12:SetPos(10,10)
-- Box13 = CppScriptMgr:AddSimplePlayer(19697,171,142,"MagicCardBox")
-- Box13:SetZoomPercent(50)
-- Box13:AddEffect("pokedakai")
-- Box13:AddEffect("en_heitQ")
local boxeffectObj5_1  = CppScriptMgr:AddEffect("pokedakai",42,40)
local boxeffectObj5_2  = CppScriptMgr:AddEffect("en_heitQ",42,40)
CppScriptMgr:WaitMilSec(500)


CppScriptMgr:WaitMilSec(800)

hero:WalkTo(48,48)
CppScriptMgr:WaitMilSec(2000)

-- 卡牌魔术师
hero:SetDir(7)
CppScriptMgr:NpcCallOut("Oh my god! You are so lucky! You got Royal Flush on your first hand! Submit it to JOKER!\n\n\n\n                                     Press ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_Magician", 150, 430, "Card Magician", 250, 655)
CppScriptMgr:WaitMilSec(1500)

CppScriptMgr:WaitMilSec(1500)

hero:SetDir(1)
local boxeffectObj1_3  = CppScriptMgr:AddEffect("kapaixunhuan",42,52)
CppScriptMgr:WaitMilSec(500)

hero:SetDir(2)
local boxeffectObj3_3  = CppScriptMgr:AddEffect("kapaixunhuan",42,46)
CppScriptMgr:WaitMilSec(500)

hero:SetDir(3)
local boxeffectObj5_3  = CppScriptMgr:AddEffect("kapaixunhuan",42,40)
CppScriptMgr:WaitMilSec(500)

hero:SetDir(5)
local boxeffectObj4_3  = CppScriptMgr:AddEffect("kapaixunhuan",54,43)
CppScriptMgr:WaitMilSec(500)

hero:SetDir(6)
local boxeffectObj2_3  = CppScriptMgr:AddEffect("kapaixunhuan",54,50)
CppScriptMgr:WaitMilSec(500)

hero:WalkTo(48,42)
hero:SetDir(4)
CppScriptMgr:WaitMilSec(500)
hero:Say("Rate my deck!", 1500)
CppScriptMgr:WaitMilSec(1500)
JOKER:Say("I can't believe it! You got Royal Flush!", 2000)

CppScriptMgr:WaitMilSec(2000)
--小丑皇出场
local effectObj20  = CppScriptMgr:AddEffect("HangUpGetExp",48,53)
CppScriptMgr:WaitMilSec(1000)
hero:SetDir(0)

local ClownKing  = CppScriptMgr:AddPlayer(8,48,53,"ClownMaster")
ClownKing:SetZoomPercent(130)
ClownKing:SetArmor(188915,0,1)
ClownKing:SetRWeapon(420003,0,1)
ClownKing:SetHair(80,1)
ClownKing:SetDir(4)

ClownKing:Say("Give me your Royal Flush!", 1500)
CppScriptMgr:WaitMilSec(1500)


-- 卡牌魔术师
CppScriptMgr:NpcCallOut("Don`t let Clown Master take away your cards!\n\n\n\n                                     Press ESC to skip the story.", 1500, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_Magician", 150, 430, "Card Magician", 250, 655)
CppScriptMgr:WaitMilSec(1500)

-- 玩家和小丑皇交战，保住了牌组，获得了积分
ClownKing:RunTo(48,46)
CppScriptMgr:WaitMilSec(2400)
ClownKing:SetDir(4)
--小丑攻击
ClownKing:SetAction(401)
--玩家格挡
hero:SetAction(905)
CppScriptMgr:WaitMilSec(1000)
-- 玩家反击
hero:SetAction(401)
hero:Say("I won`t let you have your way! Try this!", 1500)
CppScriptMgr:WaitMilSec(500)


ClownKing:SetAction(330)
CppScriptMgr:WaitMilSec(2000)
ClownKing:SetPos(10,10)

CppScriptMgr:WaitMilSec(1000)
-- 卡牌魔术师
CppScriptMgr:NpcCallOut("Great! I didn`t know you are strong enough to defeat Clown Master! You can set out on a real magic journey in the Card House!\n\n\n\n                                     Press ESC to skip the story.", 2200, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_Magician", 150, 430, "Card Magician", 250, 655)
CppScriptMgr:WaitMilSec(3000)


CppScriptMgr:WaitMilSec(1500)