------------------------------------------------------------------------------------
--Name：            200915[简体征服][活动脚本]全球万圣活动
--Creator:      王贤
--Created:     2020-09-15
------------------------------------------------------------------------------------
--/callluafunc </F>User_PlayPlot</N>76

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

-- hero:SetPos(165, 230)
-- 等待1000毫秒
-- CppScriptMgr:WaitMilSec(1000)
-- 设置玩家方向，[0, 7]-八方向
-- hero:SetDir(4)
-- -- 设置外观：player:SetLook(外观type)
-- hero:SetLook(7)


CppScriptMgr:SetViewPosByCell(167,221)

local playerkid1 = CppScriptMgr:AddSimplePlayer(44925, 163,228, "Tommy", 4003000006,1)
playerkid1:SetDir(5)
playerkid1:Say("Run! Run!", 3000)
local playerkid2 = CppScriptMgr:AddSimplePlayer(44933, 168,230, "Jimmy", 4003000007,1)
playerkid2:SetDir(3)
playerkid2:Say("You can`t catch me!", 3000)
local playerkid3 = CppScriptMgr:AddSimplePlayer(44940, 171,216, "Jojo", 4003000008,1)
playerkid3:SetDir(0)
playerkid3:Say("scissor! I won!", 3000)
local playerkid4 = CppScriptMgr:AddSimplePlayer(45121, 162,220, "Kattie", 4003000009,1)
playerkid4:SetDir(0)
playerkid4:Say("I`m a ghost! And I`m coming for you!", 3000)
local playerkid5 = CppScriptMgr:AddSimplePlayer(45134, 171,220, "Troye", 4003000010,1)
playerkid5:SetDir(4)
playerkid5:Say("Rock scissors paper!", 3000)

local player1 = CppScriptMgr:AddSimplePlayer(44970, 109,212, "Wooden Armchair", 4003000001,1)
local player2 = CppScriptMgr:AddSimplePlayer(44980, 123,194, "Scarecrow", 4003000002,1)
local player3 = CppScriptMgr:AddSimplePlayer(45190, 197,212, "Snowman", 4003000003,1)

CppScriptMgr:WaitMilSec(2000)

CppScriptMgr:AddEffect("SuperXp_coat01",165,219)
CppScriptMgr:WaitMilSec(1000)

local playerkid6 = CppScriptMgr:AddSimplePlayer(1059780, 165,219, "Clown", 4003000004,1)
playerkid6:SetZoomPercent(150)
CppScriptMgr:NpcCallOut("I`m back again! Muahaha! Kids! Kids! I`ll catch you and turn you into my favorite things!", 3000, 1, "NPCBust_bg", "", 320, 570, 400, 580, "NPCBust_Clown", 150, 430, "Clown", 250, 655)


playerkid1:Say("Run!", 3000)
playerkid2:Say("Run faster!", 3000)
playerkid3:Say("Wah wah wah!", 3000)
playerkid4:Say("Mum! I want my mum!", 3000)
playerkid5:Say("Help!", 3000)
CppScriptMgr:WaitMilSec(2000)

playerkid1:SetDir(0)
playerkid2:SetDir(0)

for i = 1, 50 do
	playerkid1:SetPos(163, 228 + i)
	playerkid2:SetPos(168, 230 + i)
	CppScriptMgr:WaitMilSec(50)
end

playerkid6:Say("Damn! 2 of them ran away! Never mind, there are still 3! Hehehe!", 3000)
CppScriptMgr:WaitMilSec(2000)

CppScriptMgr:AddEffect("windupatt907",165,219)
CppScriptMgr:WaitMilSec(100)
playerkid3:SetPos(999,999)
playerkid4:SetPos(999,999)
playerkid5:SetPos(999,999)
playerkid6:SetPos(999,999)
CppScriptMgr:WaitMilSec(2000)

for i = 1, 9 do
	CppScriptMgr:SetViewPosByCell(167 - i,221 - i)
	CppScriptMgr:WaitMilSec(20)
end

for i = 1, 49 do
	CppScriptMgr:SetViewPosByCell(158 - i,212)
	CppScriptMgr:WaitMilSec(20)
end

CppScriptMgr:AddEffect("purpleray",109,212)

CppScriptMgr:WaitMilSec(2000)

for i = 1, 14 do
	CppScriptMgr:SetViewPosByCell(109 + i,212 - i)
	CppScriptMgr:WaitMilSec(20)
end
for i = 1, 4 do
	CppScriptMgr:SetViewPosByCell(123,198 - i)
	CppScriptMgr:WaitMilSec(20)
end

CppScriptMgr:AddEffect("purpleray",123,194)

CppScriptMgr:WaitMilSec(2000)

for i = 1, 18 do
	CppScriptMgr:SetViewPosByCell(123 + i,194 + i)
	CppScriptMgr:WaitMilSec(20)
end
for i = 1, 56 do
	CppScriptMgr:SetViewPosByCell(141 + i,212)
	CppScriptMgr:WaitMilSec(20)
end

CppScriptMgr:AddEffect("purpleray",197,212)

playerkid6:SetPos(126,191)
playerkid6:Say("Hehehe! I`ve got 3 more kids!", 3000)
CppScriptMgr:WaitMilSec(2000)

for i = 1, 9 do
	CppScriptMgr:SetViewPosByCell(197 - i,212 + i)
	CppScriptMgr:WaitMilSec(20)
end
for i = 1, 21 do
	CppScriptMgr:SetViewPosByCell(188 - i,221)
	CppScriptMgr:WaitMilSec(20)
end

playerkid1:SetDir(5)
playerkid2:SetDir(3)

playerkid1:SetPos(160,224)
playerkid2:SetPos(170,224)
playerkid1:Say("The Clown is so scary!", 3000)
playerkid2:Say("Where are my friends? Help us!", 3000)


CppScriptMgr:WaitMilSec(2000)






