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

-- 怪物
monsters = {
	{ config_id = 433, monster_id = 28050101, pos = { x = 1741.6, y = 273.8, z = -936.4 }, rot = { x = 0.0, y = 0.0, z = 0.0 }, level = 0 },
	{ config_id = 434, monster_id = 20010301, pos = { x = 1744.0, y = 274.2, z = -934.1 }, rot = { x = 0.0, y = 0.0, z = 0.0 }, level = 7 },
	{ config_id = 435, monster_id = 20010301, pos = { x = 1737.7, y = 272.8, z = -943.3 }, rot = { x = 0.0, y = 0.0, z = 0.0 }, level = 7 },
	{ config_id = 436, monster_id = 20010301, pos = { x = 1747.6, y = 273.8, z = -937.6 }, rot = { x = 0.0, y = 0.0, z = 0.0 }, level = 7 },
	{ config_id = 437, monster_id = 20010301, pos = { x = 1743.5, y = 272.9, z = -944.8 }, rot = { x = 0.0, y = 0.0, z = 0.0 }, level = 7 }
}

-- NPC
npcs = {
}

-- 装置
gadgets = {
}

-- 区域
regions = {
	{ config_id = 154, shape = RegionShape.SPHERE, radius = 8.5, pos = { x = 1740.2, y = 270.9, z = -936.4 } }
}

-- 触发器
triggers = {
	{ name = "ENTER_REGION_154", event = EventType.EVENT_ENTER_REGION, source = "", condition = "condition_EVENT_ENTER_REGION_154", action = "action_EVENT_ENTER_REGION_154" }
}

-- 变量
variables = {
}

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

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

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

suites = {
	{
		-- suite_id = 0,
		-- description = ,
		monsters = { 433 },
		gadgets = { },
		regions = { },
		triggers = { },
		rand_weight = 100
	},
	{
		-- suite_id = 1,
		-- description = suite_2,
		monsters = { },
		gadgets = { },
		regions = { 154 },
		triggers = { "ENTER_REGION_154" },
		rand_weight = 100
	}
}

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

-- 触发条件
function condition_EVENT_ENTER_REGION_154(context, evt)
	if evt.param1 ~= 154 then return false end
	
	-- 判断角色数量不少于1
	if ScriptLib.GetRegionEntityCount(context, { region_eid = evt.source_eid, entity_type = EntityType.AVATAR }) < 1 then
		return false
	end
	
	return true
end

-- 触发操作
function action_EVENT_ENTER_REGION_154(context, evt)
	-- 延迟0秒刷怪
	if 0 ~= ScriptLib.CreateMonster(context, { config_id = 434, delay_time = 0 }) then
	  return -1
	end
	
	-- 延迟0秒刷怪
	if 0 ~= ScriptLib.CreateMonster(context, { config_id = 435, delay_time = 0 }) then
	  return -1
	end
	
	-- 延迟0秒刷怪
	if 0 ~= ScriptLib.CreateMonster(context, { config_id = 436, delay_time = 0 }) then
	  return -1
	end
	
	-- 延迟0秒刷怪
	if 0 ~= ScriptLib.CreateMonster(context, { config_id = 437, delay_time = 0 }) then
	  return -1
	end
	
	return 0
end
