------------------------------------------------------------------------------------
--Name：            200319[简体征服][活动脚本]全球周年庆剧情
--Creator:      蔡颖静
--Created:     2020-03-19
------------------------------------------------------------------------------------
--/callluafunc </F>User_PlayPlot</N>23
--/reloadlua Script/Aniversary2020Guide.lua


-- 设置摄像机指向位置(网格坐标)
CppScriptMgr:SetViewPosByCell(440, 666)
------------------------------------------------------------
--玩家对象操作接口,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 effectObj = CppScriptMgr:AddEffect("moveback", 440, 679);
CppScriptMgr:WaitMilSec(1500);

local hero = CppScriptMgr:QueryHero();
hero:SetLook(hero:GetLook(), false, true) ;
hero:SetZoomPercent(100)
hero:SetPos(440, 679)
hero:SetDir(4)

--创建甄小福
local playerNpcNew  = CppScriptMgr:AddSimplePlayer(1065434, 443,676, "LittleLuckyStar", 4003000115,1)
playerNpcNew:SetZoomPercent(100)


--创建金蛋
local player  = CppScriptMgr:AddSimplePlayer(29310, 440,664, "GoldenEgg", 4003000100,1)
player:SetZoomPercent(230)
player:AddEffect("goldendragon",440,664);
player:AddEffect("zf2-e1211",440,664);
player:AddEffect("attackup1",440,664);

CppScriptMgr:WaitMilSec(1500);
CppScriptMgr:NpcCallOut("     The Golden Egg is in the middle of the altar. Go to have a look!\n\n\n\n                                     Press ESC to skip the story.", 3000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc26069", 150, 430, "LittleLuckyStar", 250, 655);

CppScriptMgr:WaitMilSec(1000);
hero:RunTo(440, 669)
CppScriptMgr:WaitMilSec(3000);
hero:SetAction(230);
hero:Say("Wow, I have never seen such a big golden egg.", 2000);
CppScriptMgr:WaitMilSec(2000);

--移动到龙蛋位置
hero:RunTo(442, 665);
CppScriptMgr:WaitMilSec(1000);
hero:SetDir(3);
CppScriptMgr:WaitMilSec(500);
-- hero:Say("What kind of egg is this?", 2000);
-- CppScriptMgr:WaitMilSec(1000);
--出现半身像
CppScriptMgr:NpcCallOut("     This Golden Egg seems to entail a great power.\n\n\n\n                                     Press ESC to skip the story.", 2000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc26069", 150, 430, "LittleLuckyStar", 250, 655);
CppScriptMgr:WaitMilSec(1000);
hero:RunTo(442, 662);
CppScriptMgr:WaitMilSec(1000);
hero:SetDir(1);
CppScriptMgr:WaitMilSec(1000);
hero:Say("What kind of egg is this?", 2000);
CppScriptMgr:WaitMilSec(1500);
--出现半身像
CppScriptMgr:NpcCallOut("     Well-informed as I am, I can`t tell what kind of egg it is.\n\n\n\n                                     Press ESC to skip the story.", 3000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc26069", 150, 430, "LittleLuckyStar", 250, 655);
CppScriptMgr:WaitMilSec(1000);
hero:RunTo(438, 662);
CppScriptMgr:WaitMilSec(1000);
hero:SetDir(7);
CppScriptMgr:WaitMilSec(1500);
--出现半身像
CppScriptMgr:NpcCallOut("     But I can assure you that this Golden Egg is something precious! Take it back to Twin City first.\n\n\n\n                                     Press ESC to skip the story.", 2000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc26069", 150, 430, "LittleLuckyStar", 250, 655);
hero:RunTo(438, 665);
CppScriptMgr:WaitMilSec(1000);
hero:SetDir(5);
CppScriptMgr:WaitMilSec(2000);
hero:SetAction(230);
hero:Say("Take it back to Twin City first.", 2000);
CppScriptMgr:WaitMilSec(1500);
player:SetHide(1);
hero:JumpTo(442, 685);

-- 黑屏, CppScriptMgr:SetDarkScreen(毫秒)
CppScriptMgr:SetDarkScreen(3000)
CppScriptMgr:WaitMilSec(2500)

CppScriptMgr:SetViewPosByCell(376, 445)
--移动到双龙城
CppScriptMgr:SetLightScreen(2000);

--播放传送光效
local effectObj1 = CppScriptMgr:AddEffect("moveback", 381, 451);
local effectObj2 = CppScriptMgr:AddEffect("moveback", 381, 446);

CppScriptMgr:WaitMilSec(2000)

--创建玩家
local hero1 = CppScriptMgr:QueryHero();
hero1:SetLook(hero:GetLook(), false, true) ;
hero1:SetZoomPercent(100)
hero1:SetPos(381, 451)
hero1:SetDir(4)

--创建甄小福
local playerNpc  = CppScriptMgr:AddSimplePlayer(1065430, 372,446, "LittleLuckyStar", 4003000101,1)
playerNpc:SetZoomPercent(100)

--创建金蛋
local player1  = CppScriptMgr:AddSimplePlayer(29310, 381,446, "GoldenEgg", 4003000102,1)
player1:SetZoomPercent(230)

--创建酱油npc
local playerJY1  = CppScriptMgr:AddSimplePlayer(1056022, 385,446, "Shopboy", 4003000110,1)
playerJY1:SetZoomPercent(100)

local playerJY2  = CppScriptMgr:AddSimplePlayer(1063903, 381,442, "Warehouseman", 4003000111,1)
playerJY2:SetZoomPercent(100)

--增加地效
local effectObjDX = CppScriptMgr:AddEffect("DX_zhounianqing",374, 439);

player1:AddEffect("zf2-e280_1",381,446);
CppScriptMgr:WaitMilSec(3000);
player1:Say("The Golden Egg starts shaking and absorbing the auspicious air!", 3000);
CppScriptMgr:WaitMilSec(5000);
player1:AddEffect("accession",381,446);
player1:Say("The Golden Egg cracked.", 3000);
CppScriptMgr:WaitMilSec(3000);

hero1:Say("What happens to the Golden Egg?", 3000);
CppScriptMgr:WaitMilSec(2000);

playerNpc:SetAction(160);
--出现半身像
CppScriptMgr:NpcCallOut("    It seems that the Golden Egg is about to hatch!\n\n\n\n                                     Press ESC to skip the story.", 5000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc26069", 150, 430, "LittleLuckyStar", 250, 655);

CppScriptMgr:WaitMilSec(2000);
playerJY1:SetAction(200);
playerJY1:Say("The Golden Egg will bring us auspiciousness!", 5000);


playerJY2:SetAction(200);
playerJY2:Say("Golden Egg, please bless my business!", 5000);
CppScriptMgr:WaitMilSec(2000);

local effectObj3 = CppScriptMgr:AddEffect("accession",375, 446);
local effectObj4 = CppScriptMgr:AddEffect("accession1",387, 446);
local effectObj5 = CppScriptMgr:AddEffect("accession2",378, 450);
local effectObj6 = CppScriptMgr:AddEffect("accession3",384, 450);
local effectObj7 = CppScriptMgr:AddEffect("accession4",378, 442);
local effectObj8 = CppScriptMgr:AddEffect("accession5",384, 442);
player1:SetZoomPercent(260);
CppScriptMgr:WaitMilSec(2000);

player1:SetHide(1);

CppScriptMgr:WaitMilSec(1500);
--出现小龙
local player2  = CppScriptMgr:AddSimplePlayer(1059950, 381,446, "HeavenDragon(Infancy)", 4003000103,1)
player2:SetZoomPercent(30)
player2:AddEffect("lottery",381,446);
CppScriptMgr:WaitMilSec(1000);
player2:WalkTo(381, 449);
CppScriptMgr:WaitMilSec(2000);
player2:Say("The baby dragon rubs itself on you. It`s distinguishing your smell.", 2000);
--播放爱心光效
player2:AddEffect("NEW-flower-r-1",377,448);
hero1:AddEffect("NEW-flower-r-1",381,451);
CppScriptMgr:WaitMilSec(2000);
hero1:SetAction(180);
hero1:Say("So cute. Let me take care of it!", 5000);

CppScriptMgr:WaitMilSec(2000);
playerNpc:SetAction(170);
--出现半身像
CppScriptMgr:NpcCallOut("     Oh my god! This is the egg of the Heaven Dragon! It regards you as the master.\n\n\n\n                                     Press ESC to skip the story.", 5000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_npc26069", 150, 430, "LittleLuckyStar", 250, 655)
CppScriptMgr:WaitMilSec(3000);

playerJY1:SetAction(1);
playerJY1:Say("Peace comes with the dragon!", 4000);

playerJY2:SetAction(1);
playerJY2:Say("My business will go well under its blessing!", 4000);

CppScriptMgr:WaitMilSec(5000)






