-- 基础信息
local base_info = {
	group_id = 133001583
}

-- DEFS_MISCS
local defs = {
	RegionID =  583049
}

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

-- 怪物
monsters = {
}

-- NPC
npcs = {
}

-- 装置
gadgets = {
	[583001] = { config_id = 583001, gadget_id = 70900340, pos = { x = 1566.299, y = 252.085, z = -1638.758 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 15, area_id = 2 },
	[583002] = { config_id = 583002, gadget_id = 70900340, pos = { x = 1568.004, y = 252.085, z = -1640.892 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 15, area_id = 2 },
	[583003] = { config_id = 583003, gadget_id = 70900340, pos = { x = 1563.496, y = 252.084, z = -1638.007 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 15, area_id = 2 },
	[583004] = { config_id = 583004, gadget_id = 70900340, pos = { x = 1563.597, y = 252.085, z = -1635.979 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 15, area_id = 2 },
	[583005] = { config_id = 583005, gadget_id = 70900340, pos = { x = 1561.353, y = 252.085, z = -1636.728 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 15, area_id = 2 },
	[583006] = { config_id = 583006, gadget_id = 70900340, pos = { x = 1559.648, y = 252.085, z = -1638.560 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 15, area_id = 2 },
	[583007] = { config_id = 583007, gadget_id = 70900340, pos = { x = 1558.810, y = 252.084, z = -1643.201 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 15, area_id = 2 },
	[583008] = { config_id = 583008, gadget_id = 70900340, pos = { x = 1560.039, y = 252.084, z = -1645.676 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 15, area_id = 2 },
	[583009] = { config_id = 583009, gadget_id = 70900340, pos = { x = 1562.628, y = 252.084, z = -1646.740 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 15, area_id = 2 },
	[583010] = { config_id = 583010, gadget_id = 70900340, pos = { x = 1566.551, y = 252.084, z = -1646.714 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 15, area_id = 2 },
	[583011] = { config_id = 583011, gadget_id = 70900340, pos = { x = 1568.881, y = 252.084, z = -1644.919 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 15, area_id = 2 },
	[583012] = { config_id = 583012, gadget_id = 70900340, pos = { x = 1570.379, y = 252.085, z = -1642.635 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 15, area_id = 2 },
	[583021] = { config_id = 583021, gadget_id = 70900340, pos = { x = 1560.501, y = 252.172, z = -1641.873 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, area_id = 2 },
	[583022] = { config_id = 583022, gadget_id = 70900340, pos = { x = 1560.969, y = 252.173, z = -1640.152 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, area_id = 2 },
	[583023] = { config_id = 583023, gadget_id = 70900340, pos = { x = 1561.128, y = 252.171, z = -1643.758 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, area_id = 2 },
	[583024] = { config_id = 583024, gadget_id = 70900340, pos = { x = 1562.476, y = 252.170, z = -1645.047 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, area_id = 2 },
	[583025] = { config_id = 583025, gadget_id = 70900340, pos = { x = 1564.174, y = 252.170, z = -1645.598 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, area_id = 2 },
	[583026] = { config_id = 583026, gadget_id = 70900340, pos = { x = 1565.980, y = 252.214, z = -1645.363 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, area_id = 2 },
	[583027] = { config_id = 583027, gadget_id = 70900340, pos = { x = 1567.391, y = 252.171, z = -1644.208 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, area_id = 2 },
	[583028] = { config_id = 583028, gadget_id = 70900340, pos = { x = 1568.328, y = 252.215, z = -1642.714 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, area_id = 2 },
	[583029] = { config_id = 583029, gadget_id = 70900340, pos = { x = 1568.373, y = 252.216, z = -1641.098 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, area_id = 2 },
	[583030] = { config_id = 583030, gadget_id = 70900340, pos = { x = 1567.528, y = 252.174, z = -1639.257 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, area_id = 2 },
	[583031] = { config_id = 583031, gadget_id = 70900340, pos = { x = 1566.091, y = 252.175, z = -1638.063 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, area_id = 2 },
	[583032] = { config_id = 583032, gadget_id = 70900340, pos = { x = 1564.426, y = 252.218, z = -1637.596 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, area_id = 2 },
	[583039] = { config_id = 583039, gadget_id = 70900340, pos = { x = 1558.878, y = 252.084, z = -1640.661 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, area_id = 2 },
	[583040] = { config_id = 583040, gadget_id = 70900340, pos = { x = 1557.270, y = 252.086, z = -1639.179 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, area_id = 2 },
	[583041] = { config_id = 583041, gadget_id = 70900340, pos = { x = 1556.897, y = 252.086, z = -1641.668 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, area_id = 2 },
	[583042] = { config_id = 583042, gadget_id = 70900340, pos = { x = 1556.943, y = 252.087, z = -1643.985 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, area_id = 2 },
	[583043] = { config_id = 583043, gadget_id = 70900340, pos = { x = 1559.140, y = 252.085, z = -1644.491 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, area_id = 2 },
	[583044] = { config_id = 583044, gadget_id = 70900340, pos = { x = 1558.021, y = 252.087, z = -1646.354 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, area_id = 2 },
	[583050] = { config_id = 583050, gadget_id = 70710001, pos = { x = 1566.132, y = 252.081, z = -1639.927 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, area_id = 2 }
}

-- 区域
regions = {
	[583049] = { config_id = 583049, shape = RegionShape.SPHERE, radius = 27, pos = { x = 1564.328, y = 252.197, z = -1641.672 }, area_id = 2 }
}

-- 触发器
triggers = {
	{ config_id = 1583013, name = "TIMER_EVENT_583013", event = EventType.EVENT_TIMER_EVENT, source = "third", condition = "", action = "action_EVENT_TIMER_EVENT_583013" },
	{ config_id = 1583014, name = "TIMER_EVENT_583014", event = EventType.EVENT_TIMER_EVENT, source = "second", condition = "", action = "action_EVENT_TIMER_EVENT_583014" },
	{ config_id = 1583015, name = "TIMER_EVENT_583015", event = EventType.EVENT_TIMER_EVENT, source = "first", condition = "", action = "action_EVENT_TIMER_EVENT_583015" },
	{ config_id = 1583016, name = "GADGET_CREATE_583016", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_583016", action = "action_EVENT_GADGET_CREATE_583016" },
	{ config_id = 1583017, name = "GADGET_CREATE_583017", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_583017", action = "action_EVENT_GADGET_CREATE_583017" },
	{ config_id = 1583018, name = "GADGET_CREATE_583018", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_583018", action = "action_EVENT_GADGET_CREATE_583018" },
	{ config_id = 1583019, name = "TIMER_EVENT_583019", event = EventType.EVENT_TIMER_EVENT, source = "forth", condition = "", action = "action_EVENT_TIMER_EVENT_583019" },
	{ config_id = 1583020, name = "GADGET_CREATE_583020", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_583020", action = "action_EVENT_GADGET_CREATE_583020" },
	{ config_id = 1583033, name = "TIMER_EVENT_583033", event = EventType.EVENT_TIMER_EVENT, source = "sixth", condition = "", action = "action_EVENT_TIMER_EVENT_583033" },
	{ config_id = 1583034, name = "TIMER_EVENT_583034", event = EventType.EVENT_TIMER_EVENT, source = "seventh", condition = "", action = "action_EVENT_TIMER_EVENT_583034" },
	{ config_id = 1583035, name = "TIMER_EVENT_583035", event = EventType.EVENT_TIMER_EVENT, source = "fifth", condition = "", action = "action_EVENT_TIMER_EVENT_583035" },
	{ config_id = 1583036, name = "GADGET_CREATE_583036", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_583036", action = "action_EVENT_GADGET_CREATE_583036" },
	{ config_id = 1583037, name = "GADGET_CREATE_583037", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_583037", action = "action_EVENT_GADGET_CREATE_583037" },
	{ config_id = 1583038, name = "GADGET_CREATE_583038", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_583038", action = "action_EVENT_GADGET_CREATE_583038" },
	{ config_id = 1583045, name = "TIMER_EVENT_583045", event = EventType.EVENT_TIMER_EVENT, source = "eighth", condition = "", action = "action_EVENT_TIMER_EVENT_583045" },
	{ config_id = 1583046, name = "GADGET_CREATE_583046", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_583046", action = "action_EVENT_GADGET_CREATE_583046" },
	{ config_id = 1583047, name = "TIMER_EVENT_583047", event = EventType.EVENT_TIMER_EVENT, source = "nine", condition = "", action = "action_EVENT_TIMER_EVENT_583047" },
	{ config_id = 1583048, name = "GADGET_CREATE_583048", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_583048", action = "action_EVENT_GADGET_CREATE_583048" }
}

-- 变量
variables = {
}

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

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

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

suites = {
	{
		-- suite_id = 1,
		-- description = ,
		monsters = { },
		gadgets = { },
		regions = { 583049 },
		triggers = { },
		rand_weight = 100
	},
	{
		-- suite_id = 2,
		-- description = ,
		monsters = { },
		gadgets = { 583001, 583002, 583003, 583050 },
		regions = { },
		triggers = { },
		rand_weight = 100
	},
	{
		-- suite_id = 3,
		-- description = ,
		monsters = { },
		gadgets = { 583004, 583005, 583006, 583050 },
		regions = { },
		triggers = { "TIMER_EVENT_583014", "GADGET_CREATE_583017" },
		rand_weight = 100
	},
	{
		-- suite_id = 4,
		-- description = ,
		monsters = { },
		gadgets = { 583007, 583008, 583009, 583050 },
		regions = { },
		triggers = { "TIMER_EVENT_583013", "GADGET_CREATE_583016" },
		rand_weight = 100
	},
	{
		-- suite_id = 5,
		-- description = ,
		monsters = { },
		gadgets = { 583010, 583011, 583012, 583050 },
		regions = { },
		triggers = { "TIMER_EVENT_583019", "GADGET_CREATE_583020" },
		rand_weight = 100
	},
	{
		-- suite_id = 6,
		-- description = ,
		monsters = { },
		gadgets = { 583021, 583022, 583023, 583050 },
		regions = { },
		triggers = { "TIMER_EVENT_583035", "GADGET_CREATE_583038" },
		rand_weight = 100
	},
	{
		-- suite_id = 7,
		-- description = ,
		monsters = { },
		gadgets = { 583024, 583025, 583026, 583050 },
		regions = { },
		triggers = { "TIMER_EVENT_583033", "GADGET_CREATE_583036" },
		rand_weight = 100
	},
	{
		-- suite_id = 8,
		-- description = ,
		monsters = { },
		gadgets = { 583027, 583028, 583029, 583050 },
		regions = { },
		triggers = { "TIMER_EVENT_583034", "GADGET_CREATE_583037" },
		rand_weight = 100
	},
	{
		-- suite_id = 9,
		-- description = ,
		monsters = { },
		gadgets = { 583030, 583031, 583032, 583050 },
		regions = { },
		triggers = { "TIMER_EVENT_583045", "GADGET_CREATE_583046" },
		rand_weight = 100
	},
	{
		-- suite_id = 10,
		-- description = ,
		monsters = { },
		gadgets = { 583039, 583040, 583041, 583050 },
		regions = { },
		triggers = { "TIMER_EVENT_583047", "GADGET_CREATE_583048" },
		rand_weight = 100
	},
	{
		-- suite_id = 11,
		-- description = ,
		monsters = { },
		gadgets = { 583042, 583043, 583044, 583050 },
		regions = { },
		triggers = { },
		rand_weight = 100
	}
}

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

-- 触发操作
function action_EVENT_TIMER_EVENT_583013(context, evt)
	-- 添加suite5的新内容
	    ScriptLib.AddExtraGroupSuite(context, 133001583, 5)
	
	return 0
end

-- 触发操作
function action_EVENT_TIMER_EVENT_583014(context, evt)
	-- 添加suite4的新内容
	    ScriptLib.AddExtraGroupSuite(context, 133001583, 4)
	
	return 0
end

-- 触发操作
function action_EVENT_TIMER_EVENT_583015(context, evt)
	-- 添加suite3的新内容
	    ScriptLib.AddExtraGroupSuite(context, 133001583, 3)
	
	return 0
end

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

-- 触发操作
function action_EVENT_GADGET_CREATE_583016(context, evt)
	-- 延迟24秒后,向groupId为：133001583的对象,请求一次调用,并将string参数："third" 传递过去
	if 0 ~= ScriptLib.CreateGroupTimerEvent(context, 133001583, "third", 24) then
	  ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_timerevent_by_group")
	  return -1
	end
	
	return 0
end

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

-- 触发操作
function action_EVENT_GADGET_CREATE_583017(context, evt)
	-- 延迟24秒后,向groupId为：133001583的对象,请求一次调用,并将string参数："second" 传递过去
	if 0 ~= ScriptLib.CreateGroupTimerEvent(context, 133001583, "second", 24) then
	  ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_timerevent_by_group")
	  return -1
	end
	
	return 0
end

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

-- 触发操作
function action_EVENT_GADGET_CREATE_583018(context, evt)
	-- 延迟24秒后,向groupId为：133001583的对象,请求一次调用,并将string参数："first" 传递过去
	if 0 ~= ScriptLib.CreateGroupTimerEvent(context, 133001583, "first", 24) then
	  ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_timerevent_by_group")
	  return -1
	end
	
	return 0
end

-- 触发操作
function action_EVENT_TIMER_EVENT_583019(context, evt)
	-- 添加suite6的新内容
	    ScriptLib.AddExtraGroupSuite(context, 133001583, 6)
	
	return 0
end

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

-- 触发操作
function action_EVENT_GADGET_CREATE_583020(context, evt)
	-- 延迟24秒后,向groupId为：133001583的对象,请求一次调用,并将string参数："forth" 传递过去
	if 0 ~= ScriptLib.CreateGroupTimerEvent(context, 133001583, "forth", 24) then
	  ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_timerevent_by_group")
	  return -1
	end
	
	return 0
end

-- 触发操作
function action_EVENT_TIMER_EVENT_583033(context, evt)
	-- 添加suite8的新内容
	    ScriptLib.AddExtraGroupSuite(context, 133001583, 8)
	
	return 0
end

-- 触发操作
function action_EVENT_TIMER_EVENT_583034(context, evt)
	-- 添加suite9的新内容
	    ScriptLib.AddExtraGroupSuite(context, 133001583, 9)
	
	return 0
end

-- 触发操作
function action_EVENT_TIMER_EVENT_583035(context, evt)
	-- 添加suite7的新内容
	    ScriptLib.AddExtraGroupSuite(context, 133001583, 7)
	
	return 0
end

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

-- 触发操作
function action_EVENT_GADGET_CREATE_583036(context, evt)
	-- 延迟24秒后,向groupId为：133001583的对象,请求一次调用,并将string参数："sixth" 传递过去
	if 0 ~= ScriptLib.CreateGroupTimerEvent(context, 133001583, "sixth", 24) then
	  ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_timerevent_by_group")
	  return -1
	end
	
	return 0
end

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

-- 触发操作
function action_EVENT_GADGET_CREATE_583037(context, evt)
	-- 延迟24秒后,向groupId为：133001583的对象,请求一次调用,并将string参数："seventh" 传递过去
	if 0 ~= ScriptLib.CreateGroupTimerEvent(context, 133001583, "seventh", 24) then
	  ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_timerevent_by_group")
	  return -1
	end
	
	return 0
end

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

-- 触发操作
function action_EVENT_GADGET_CREATE_583038(context, evt)
	-- 延迟24秒后,向groupId为：133001583的对象,请求一次调用,并将string参数："fifth" 传递过去
	if 0 ~= ScriptLib.CreateGroupTimerEvent(context, 133001583, "fifth", 24) then
	  ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_timerevent_by_group")
	  return -1
	end
	
	return 0
end

-- 触发操作
function action_EVENT_TIMER_EVENT_583045(context, evt)
	-- 添加suite10的新内容
	    ScriptLib.AddExtraGroupSuite(context, 133001583, 10)
	
	return 0
end

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

-- 触发操作
function action_EVENT_GADGET_CREATE_583046(context, evt)
	-- 延迟24秒后,向groupId为：133001583的对象,请求一次调用,并将string参数："eighth" 传递过去
	if 0 ~= ScriptLib.CreateGroupTimerEvent(context, 133001583, "eighth", 24) then
	  ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_timerevent_by_group")
	  return -1
	end
	
	return 0
end

-- 触发操作
function action_EVENT_TIMER_EVENT_583047(context, evt)
	-- 添加suite11的新内容
	    ScriptLib.AddExtraGroupSuite(context, 133001583, 11)
	
	return 0
end

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

-- 触发操作
function action_EVENT_GADGET_CREATE_583048(context, evt)
	-- 延迟24秒后,向groupId为：133001583的对象,请求一次调用,并将string参数："nine" 传递过去
	if 0 ~= ScriptLib.CreateGroupTimerEvent(context, 133001583, "nine", 24) then
	  ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_timerevent_by_group")
	  return -1
	end
	
	return 0
end

require "Activity_ArenaChallengeSub"