--================================================================
-- 
-- 配置
-- 
--================================================================

-- 怪物
monsters = {
	{ config_id = 439, monster_id = 20011202, pos = { x = 2561.6, y = 211.6, z = -1342.4 }, rot = { x = 0.0, y = 341.9, z = 0.0 }, level = 1, disableWander = true }
}

-- NPC
npcs = {
}

-- 装置
gadgets = {
}

-- 区域
regions = {
	{ config_id = 514, shape = RegionShape.SPHERE, radius = 5, pos = { x = 2564.0, y = 212.0, z = -1339.9 } },
	{ config_id = 529, shape = RegionShape.SPHERE, radius = 5, pos = { x = 2564.8, y = 212.6, z = -1335.6 } },
	{ config_id = 530, shape = RegionShape.SPHERE, radius = 5, pos = { x = 2564.8, y = 213.0, z = -1333.4 } }
}

-- 触发器
triggers = {
	{ name = "ANY_MONSTER_DIE_514", event = EventType.EVENT_ANY_MONSTER_DIE, source = "", condition = "condition_EVENT_ANY_MONSTER_DIE_514", action = "action_EVENT_ANY_MONSTER_DIE_514", trigger_count = 0 },
	{ name = "ANY_MONSTER_LIVE_529", event = EventType.EVENT_ANY_MONSTER_LIVE, source = "", condition = "condition_EVENT_ANY_MONSTER_LIVE_529", action = "action_EVENT_ANY_MONSTER_LIVE_529" },
	{ name = "TIMER_EVENT_530", event = EventType.EVENT_TIMER_EVENT, source = "delay1", condition = "", action = "action_EVENT_TIMER_EVENT_530" }
}

-- 变量
variables = {
}

--================================================================
-- 
-- 初始化配置
-- 
--================================================================

-- 初始化时创建
init_config = {
	suite = 1,
	rand_suite = false,
	npcs = { }
}

--================================================================
-- 
-- 小组配置
-- 
--================================================================

suites = {
	{
		-- suite_id = 0,
		-- description = suite_1,
		monsters = { },
		gadgets = { },
		regions = { },
		triggers = { },
		rand_weight = 100
	},
	{
		-- suite_id = 1,
		-- description = suite_2,
		monsters = { 439 },
		gadgets = { },
		regions = { 514, 529, 530 },
		triggers = { "ANY_MONSTER_DIE_514", "ANY_MONSTER_LIVE_529", "TIMER_EVENT_530" },
		rand_weight = 100
	},
	{
		-- suite_id = 2,
		-- description = suite_3,
		monsters = { },
		gadgets = { },
		regions = { },
		triggers = { },
		rand_weight = 100
	},
	{
		-- suite_id = 3,
		-- description = suite_4,
		monsters = { },
		gadgets = { },
		regions = { },
		triggers = { },
		rand_weight = 100
	}
}

--================================================================
-- 
-- 触发器
-- 
--================================================================

-- 触发条件
function condition_EVENT_ANY_MONSTER_DIE_514(context, evt)
	-- 判断剩余怪物数量是否是0
	if ScriptLib.GetGroupMonsterCount(context) ~= 0 then
		return false
	end
	
	return true
end

-- 触发操作
function action_EVENT_ANY_MONSTER_DIE_514(context, evt)
	-- 通知任务系统完成条件类型"LUA通知"，复杂参数为quest_param的进度+1
	if 0 ~= ScriptLib.AddQuestProgress(context, "1330030022") then
	  return -1
	end
	
	return 0
end

-- 触发条件
function condition_EVENT_ANY_MONSTER_LIVE_529(context, evt)
	if 439 ~= evt.param1 then
		return false
	end
	
	return true
end

-- 触发操作
function action_EVENT_ANY_MONSTER_LIVE_529(context, evt)
	-- 延迟2秒后,向groupId为：133003002的对象,请求一次调用,并将string参数："delay1" 传递过去
	if 0 ~= ScriptLib.CreateGroupTimerEvent(context, 133003002, "delay1", 2) then
	  return -1
	end
	
	return 0
end

-- 触发条件

-- 触发操作
function action_EVENT_TIMER_EVENT_530(context, evt)
	-- 通知任务系统完成条件类型"LUA通知"，复杂参数为quest_param的进度+1
	if 0 ~= ScriptLib.AddQuestProgress(context, "133003002delay1") then
	  return -1
	end
	
	return 0
end
