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

-- 怪物
monsters = {
	{ config_id = 1002, monster_id = 21010501, pos = { x = -83.1, y = 31.4, z = 68.1 }, rot = { x = 0.0, y = 180.0, z = 0.0 }, level = 1, disableWander = true, pose_id = 32 },
	{ config_id = 1003, monster_id = 21010501, pos = { x = -80.7, y = 29.9, z = 99.4 }, rot = { x = 0.0, y = 180.0, z = 0.0 }, level = 1, disableWander = true, pose_id = 32 },
	{ config_id = 1004, monster_id = 22010301, pos = { x = -77.2, y = 29.9, z = 99.6 }, rot = { x = 0.0, y = 180.0, z = 0.0 }, level = 1, disableWander = true, pose_id = 0 },
	{ config_id = 1005, monster_id = 21011001, pos = { x = -81.4, y = 28.7, z = 57.5 }, rot = { x = 0.0, y = 180.0, z = 0.0 }, level = 1, disableWander = true, pose_id = 32 },
	{ config_id = 1006, monster_id = 21011001, pos = { x = -90.2, y = 29.9, z = 110.0 }, rot = { x = 0.0, y = 180.0, z = 0.0 }, level = 1, disableWander = true, pose_id = 32 },
	{ config_id = 1007, monster_id = 21011001, pos = { x = -75.9, y = 31.2, z = 86.0 }, rot = { x = 0.0, y = 180.0, z = 0.0 }, level = 1, disableWander = true, pose_id = 32 },
	{ config_id = 1008, monster_id = 21011001, pos = { x = -77.4, y = 29.9, z = 130.2 }, rot = { x = 0.0, y = 180.0, z = 0.0 }, level = 1, disableWander = true, pose_id = 32 },
	{ config_id = 1009, monster_id = 21011001, pos = { x = -87.8, y = 29.9, z = 124.8 }, rot = { x = 0.0, y = 180.0, z = 0.0 }, level = 1, disableWander = true, pose_id = 32 },
	{ config_id = 1010, monster_id = 21010501, pos = { x = -83.4, y = 28.8, z = 59.5 }, rot = { x = 0.0, y = 180.0, z = 0.0 }, level = 1, disableWander = true, pose_id = 32 },
	{ config_id = 1011, monster_id = 21010401, pos = { x = -81.0, y = 28.7, z = 60.1 }, rot = { x = 0.0, y = 180.0, z = 0.0 }, level = 1, disableWander = true, pose_id = 402 },
	{ config_id = 1012, monster_id = 22010301, pos = { x = -81.6, y = 29.9, z = 81.8 }, rot = { x = 0.0, y = 180.0, z = 0.0 }, level = 1, disableWander = true, pose_id = 0 },
	{ config_id = 1013, monster_id = 21011001, pos = { x = -83.5, y = 30.0, z = 80.7 }, rot = { x = 0.0, y = 180.0, z = 0.0 }, level = 1, disableWander = true, pose_id = 32 },
	{ config_id = 1014, monster_id = 21010501, pos = { x = -78.9, y = 29.9, z = 96.3 }, rot = { x = 0.0, y = 180.0, z = 0.0 }, level = 1, disableWander = true, pose_id = 32 },
	{ config_id = 1015, monster_id = 21010501, pos = { x = -89.1, y = 31.9, z = 86.5 }, rot = { x = 0.0, y = 180.0, z = 0.0 }, level = 1, disableWander = true, pose_id = 32 },
	{ config_id = 1016, monster_id = 21010401, pos = { x = -75.7, y = 29.8, z = 116.7 }, rot = { x = 0.0, y = 180.0, z = 0.0 }, level = 1, disableWander = true, pose_id = 402 },
	{ config_id = 1017, monster_id = 21010401, pos = { x = -76.6, y = 29.8, z = 115.3 }, rot = { x = 0.0, y = 180.0, z = 0.0 }, level = 1, disableWander = true, pose_id = 402 },
	{ config_id = 1018, monster_id = 21010901, pos = { x = -92.4, y = 29.9, z = 109.5 }, rot = { x = 0.0, y = 180.0, z = 0.0 }, level = 1, disableWander = true, pose_id = 32 }
}

-- NPC
npcs = {
}

-- 装置
gadgets = {
	{ config_id = 1024, gadget_id = 70220005, pos = { x = 18.7, y = 0.6, z = -2.3 }, rot = { x = 0.0, y = 0.0, z = 0.0 }, level = 15 },
	{ config_id = 1025, gadget_id = 70220005, pos = { x = 18.6, y = 0.6, z = 2.1 }, rot = { x = 0.0, y = 0.0, z = 0.0 }, level = 15 },
	{ config_id = 1026, gadget_id = 70220005, pos = { x = -77.3, y = 29.8, z = 116.1 }, rot = { x = 0.0, y = 0.0, z = 0.0 }, level = 15 },
	{ config_id = 1027, gadget_id = 70220005, pos = { x = -82.0, y = 30.0, z = 149.5 }, rot = { x = 0.0, y = 160.3, z = 0.0 }, level = 15 },
	{ config_id = 1028, gadget_id = 70220005, pos = { x = -84.8, y = 30.0, z = 147.9 }, rot = { x = 0.0, y = 17.5, z = 0.0 }, level = 15 },
	{ config_id = 1029, gadget_id = 70710005, pos = { x = 77.0, y = -14.9, z = -2.9 }, rot = { x = 0.0, y = 123.1, z = 0.0 }, level = 1 },
	{ config_id = 1030, gadget_id = 70710005, pos = { x = 52.5, y = -16.4, z = 23.9 }, rot = { x = 0.0, y = 132.2, z = 0.0 }, level = 1 },
	{ config_id = 1031, gadget_id = 70710005, pos = { x = 32.7, y = -15.4, z = 5.5 }, rot = { x = 0.0, y = 288.6, z = 0.0 }, level = 1 },
	{ config_id = 1032, gadget_id = 70710005, pos = { x = -82.1, y = 11.2, z = 36.9 }, rot = { x = 0.0, y = 87.1, z = 0.0 }, level = 1 },
	{ config_id = 1033, gadget_id = 70710005, pos = { x = -74.7, y = 10.8, z = 68.0 }, rot = { x = 0.0, y = 358.1, z = 0.0 }, level = 1 },
	{ config_id = 1034, gadget_id = 70710005, pos = { x = -85.0, y = 10.1, z = 97.2 }, rot = { x = 0.0, y = 89.9, z = 0.0 }, level = 1 },
	{ config_id = 1035, gadget_id = 70710005, pos = { x = -82.3, y = 10.0, z = 117.4 }, rot = { x = 0.0, y = 324.4, z = 0.0 }, level = 1 },
	{ config_id = 1036, gadget_id = 70710005, pos = { x = -82.0, y = 10.1, z = 137.8 }, rot = { x = 0.0, y = 146.3, z = 0.0 }, level = 1 },
	{ config_id = 1037, gadget_id = 70710005, pos = { x = -88.6, y = 9.6, z = 80.3 }, rot = { x = 0.0, y = 259.8, z = 0.0 }, level = 1 }
}

-- 区域
regions = {
	{ config_id = 3, shape = RegionShape.CUBIC, size = { x = 60.0, y = 20.0, z = 15.0 }, pos = { x = -83.8, y = 30.8, z = 37.6 } }
}

-- 触发器
triggers = {
	{ name = "ENTER_REGION_3", event = EventType.EVENT_ENTER_REGION, source = "", condition = "condition_EVENT_ENTER_REGION_3", action = "action_EVENT_ENTER_REGION_3", forbid_guest = false }
}

-- 变量
variables = {
}

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

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

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

suites = {
	{
		-- suite_id = 1,
		-- description = ,
		monsters = { 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018 },
		gadgets = { 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037 },
		regions = { 3 },
		triggers = { "ENTER_REGION_3" },
		rand_weight = 100
	}
}

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

-- 触发条件
function condition_EVENT_ENTER_REGION_3(context, evt)
	if evt.param1 ~= 3 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_3(context, evt)
		-- 杀死Group内指定的monster和gadget
		if 0 ~= ScriptLib.KillGroupEntity(context, { group_id = 201015002, monsters = {}, gadgets = {2024} }) then
			return -1
		end
	
	return 0
end
