-- 基础信息 local base_info = { group_id = 240015002 } --================================================================ -- -- 配置 -- --================================================================ -- 怪物 monsters = { } -- NPC npcs = { } -- 装置 gadgets = { { config_id = 2001, gadget_id = 70310032, pos = { x = -130.665, y = 37.900, z = 105.408 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 }, { config_id = 2002, gadget_id = 70310032, pos = { x = -126.886, y = 39.016, z = 106.061 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 }, { config_id = 2003, gadget_id = 70310032, pos = { x = -117.941, y = 41.693, z = 115.405 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 }, { config_id = 2004, gadget_id = 70310032, pos = { x = -119.190, y = 42.896, z = 120.129 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 }, { config_id = 2005, gadget_id = 70310032, pos = { x = -120.249, y = 44.034, z = 125.182 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 }, { config_id = 2006, gadget_id = 70310032, pos = { x = -121.712, y = 45.524, z = 129.676 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 }, { config_id = 2007, gadget_id = 70310032, pos = { x = -123.515, y = 40.093, z = 106.339 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 } } -- 区域 regions = { } -- 触发器 triggers = { { config_id = 1002008, name = "GADGET_CREATE_2008", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_2008", action = "action_EVENT_GADGET_CREATE_2008", trigger_count = 0 }, { config_id = 1002009, name = "GADGET_CREATE_2009", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_2009", action = "action_EVENT_GADGET_CREATE_2009", trigger_count = 0 }, { config_id = 1002010, name = "TIMER_EVENT_2010", event = EventType.EVENT_TIMER_EVENT, source = "time1", condition = "", action = "action_EVENT_TIMER_EVENT_2010", trigger_count = 0 }, { config_id = 1002011, name = "TIMER_EVENT_2011", event = EventType.EVENT_TIMER_EVENT, source = "time2", condition = "", action = "action_EVENT_TIMER_EVENT_2011", trigger_count = 0 } } -- 变量 variables = { } --================================================================ -- -- 初始化配置 -- --================================================================ -- 初始化时创建 init_config = { suite = 1, end_suite = 0, rand_suite = false } --================================================================ -- -- 小组配置 -- --================================================================ suites = { { -- suite_id = 1, -- description = , monsters = { }, gadgets = { }, regions = { }, triggers = { "GADGET_CREATE_2008", "GADGET_CREATE_2009", "TIMER_EVENT_2010", "TIMER_EVENT_2011" }, rand_weight = 100 }, { -- suite_id = 2, -- description = , monsters = { }, gadgets = { 2001, 2003, 2005, 2007 }, regions = { }, triggers = { }, rand_weight = 100 }, { -- suite_id = 3, -- description = , monsters = { }, gadgets = { 2002, 2004, 2006 }, regions = { }, triggers = { }, rand_weight = 100 } } --================================================================ -- -- 触发器 -- --================================================================ -- 触发条件 function condition_EVENT_GADGET_CREATE_2008(context, evt) if 2001 ~= evt.param1 then return false end return true end -- 触发操作 function action_EVENT_GADGET_CREATE_2008(context, evt) -- 延迟5秒后,向groupId为:240015002的对象,请求一次调用,并将string参数:"time1" 传递过去 if 0 ~= ScriptLib.CreateGroupTimerEvent(context, 240015002, "time1", 5) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_timerevent_by_group") return -1 end return 0 end -- 触发条件 function condition_EVENT_GADGET_CREATE_2009(context, evt) if 2002 ~= evt.param1 then return false end return true end -- 触发操作 function action_EVENT_GADGET_CREATE_2009(context, evt) -- 延迟5秒后,向groupId为:240015002的对象,请求一次调用,并将string参数:"time2" 传递过去 if 0 ~= ScriptLib.CreateGroupTimerEvent(context, 240015002, "time2", 5) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_timerevent_by_group") return -1 end return 0 end -- 触发操作 function action_EVENT_TIMER_EVENT_2010(context, evt) -- 创建id为2002的gadget if 0 ~= ScriptLib.CreateGadget(context, { config_id = 2002 }) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_gadget") return -1 end -- 创建id为2004的gadget if 0 ~= ScriptLib.CreateGadget(context, { config_id = 2004 }) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_gadget") return -1 end -- 创建id为2006的gadget if 0 ~= ScriptLib.CreateGadget(context, { config_id = 2006 }) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_gadget") return -1 end -- 永久关闭CongfigId的Gadget,需要和Groups的RefreshWithBlock标签搭配 if 0 ~= ScriptLib.KillEntityByConfigId(context, { config_id = 2001 }) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : kill_entity_by_configId") return -1 end -- 永久关闭CongfigId的Gadget,需要和Groups的RefreshWithBlock标签搭配 if 0 ~= ScriptLib.KillEntityByConfigId(context, { config_id = 2003 }) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : kill_entity_by_configId") return -1 end -- 永久关闭CongfigId的Gadget,需要和Groups的RefreshWithBlock标签搭配 if 0 ~= ScriptLib.KillEntityByConfigId(context, { config_id = 2005 }) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : kill_entity_by_configId") return -1 end -- 永久关闭CongfigId的Gadget,需要和Groups的RefreshWithBlock标签搭配 if 0 ~= ScriptLib.KillEntityByConfigId(context, { config_id = 2007 }) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : kill_entity_by_configId") return -1 end return 0 end -- 触发操作 function action_EVENT_TIMER_EVENT_2011(context, evt) -- 创建id为2001的gadget if 0 ~= ScriptLib.CreateGadget(context, { config_id = 2001 }) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_gadget") return -1 end -- 创建id为2003的gadget if 0 ~= ScriptLib.CreateGadget(context, { config_id = 2003 }) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_gadget") return -1 end -- 创建id为2005的gadget if 0 ~= ScriptLib.CreateGadget(context, { config_id = 2005 }) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_gadget") return -1 end -- 创建id为2007的gadget if 0 ~= ScriptLib.CreateGadget(context, { config_id = 2007 }) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_gadget") return -1 end -- 永久关闭CongfigId的Gadget,需要和Groups的RefreshWithBlock标签搭配 if 0 ~= ScriptLib.KillEntityByConfigId(context, { config_id = 2002 }) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : kill_entity_by_configId") return -1 end -- 永久关闭CongfigId的Gadget,需要和Groups的RefreshWithBlock标签搭配 if 0 ~= ScriptLib.KillEntityByConfigId(context, { config_id = 2004 }) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : kill_entity_by_configId") return -1 end -- 永久关闭CongfigId的Gadget,需要和Groups的RefreshWithBlock标签搭配 if 0 ~= ScriptLib.KillEntityByConfigId(context, { config_id = 2006 }) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : kill_entity_by_configId") return -1 end return 0 end