-- 基础信息 local base_info = { group_id = 240048004 } --================================================================ -- -- 配置 -- --================================================================ -- 怪物 monsters = { } -- NPC npcs = { } -- 装置 gadgets = { { config_id = 4001, gadget_id = 70290140, pos = { x = -109.975, y = 1.356, z = -66.154 }, rot = { x = 0.000, y = 90.000, z = 0.000 }, level = 1 }, { config_id = 4002, gadget_id = 70290145, pos = { x = -109.187, y = 7.464, z = -66.123 }, rot = { x = 0.000, y = 90.000, z = 0.000 }, level = 1 }, { config_id = 4003, gadget_id = 70290146, pos = { x = -109.694, y = 3.637, z = -66.162 }, rot = { x = 0.000, y = 90.000, z = 0.000 }, level = 1 }, { config_id = 4004, gadget_id = 70210101, pos = { x = -70.299, y = 2.456, z = -42.697 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, drop_tag = "搜刮点解谜人文稻妻", isOneoff = true, persistent = true }, { config_id = 4005, gadget_id = 70290144, pos = { x = -109.642, y = 3.157, z = -65.575 }, rot = { x = 0.000, y = 90.000, z = 0.000 }, level = 1 }, { config_id = 4006, gadget_id = 70290143, pos = { x = -109.649, y = 3.161, z = -66.727 }, rot = { x = 0.000, y = 90.000, z = 0.000 }, level = 1 }, { config_id = 4007, gadget_id = 70360001, pos = { x = -109.939, y = 1.356, z = -66.362 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 }, { config_id = 4009, gadget_id = 70210101, pos = { x = -70.819, y = 2.307, z = -45.262 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, drop_tag = "搜刮点解谜人文稻妻", isOneoff = true, persistent = true }, { config_id = 4013, gadget_id = 70210101, pos = { x = -101.316, y = 2.378, z = -42.500 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, drop_tag = "搜刮点解谜人文稻妻", isOneoff = true, persistent = true }, { config_id = 4014, gadget_id = 70210101, pos = { x = -103.508, y = 2.391, z = -42.457 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, drop_tag = "搜刮点解谜人文稻妻", isOneoff = true, persistent = true }, { config_id = 4015, gadget_id = 70210101, pos = { x = -117.035, y = 2.404, z = -69.550 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, drop_tag = "搜刮点解谜果蔬稻妻", isOneoff = true, persistent = true } } -- 区域 regions = { } -- 触发器 triggers = { { config_id = 1004008, name = "TIMER_EVENT_4008", event = EventType.EVENT_TIMER_EVENT, source = "time1", condition = "", action = "action_EVENT_TIMER_EVENT_4008" }, { config_id = 1004010, name = "GADGET_STATE_CHANGE_4010", event = EventType.EVENT_GADGET_STATE_CHANGE, source = "", condition = "condition_EVENT_GADGET_STATE_CHANGE_4010", action = "action_EVENT_GADGET_STATE_CHANGE_4010" }, { config_id = 1004011, name = "GADGET_STATE_CHANGE_4011", event = EventType.EVENT_GADGET_STATE_CHANGE, source = "", condition = "condition_EVENT_GADGET_STATE_CHANGE_4011", action = "action_EVENT_GADGET_STATE_CHANGE_4011" }, { config_id = 1004012, name = "SELECT_OPTION_4012", event = EventType.EVENT_SELECT_OPTION, source = "", condition = "condition_EVENT_SELECT_OPTION_4012", action = "action_EVENT_SELECT_OPTION_4012" } } -- 变量 variables = { } --================================================================ -- -- 初始化配置 -- --================================================================ -- 初始化时创建 init_config = { suite = 1, end_suite = 0, rand_suite = false } --================================================================ -- -- 小组配置 -- --================================================================ suites = { { -- suite_id = 1, -- description = , monsters = { }, gadgets = { 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4009, 4013, 4014, 4015 }, regions = { }, triggers = { "TIMER_EVENT_4008", "GADGET_STATE_CHANGE_4010", "GADGET_STATE_CHANGE_4011", "SELECT_OPTION_4012" }, rand_weight = 100 } } --================================================================ -- -- 触发器 -- --================================================================ -- 触发操作 function action_EVENT_TIMER_EVENT_4008(context, evt) -- 设置操作台选项 if 0 ~= ScriptLib.SetWorktopOptionsByGroupId(context, 240048004, 4007, {1}) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_wok_options_by_configid") return -1 end -- 改变指定group组240048004中, configid为4003的gadget的state if 0 ~= ScriptLib.SetGroupGadgetStateByConfigId(context, 240048004, 4003, GadgetState.GearStart) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_GroupId_ConfigId") return -1 end return 0 end -- 触发条件 function condition_EVENT_GADGET_STATE_CHANGE_4010(context, evt) -- 检测config_id为4001的gadget是否从GadgetState.Default变为GadgetState.GearStart if 4001 ~= evt.param2 or GadgetState.GearStart ~= evt.param1 or GadgetState.Default ~= evt.param3 then return false end return true end -- 触发操作 function action_EVENT_GADGET_STATE_CHANGE_4010(context, evt) -- 改变指定group组240048004中, configid为4005的gadget的state if 0 ~= ScriptLib.SetGroupGadgetStateByConfigId(context, 240048004, 4005, GadgetState.Action01) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_GroupId_ConfigId") return -1 end return 0 end -- 触发条件 function condition_EVENT_GADGET_STATE_CHANGE_4011(context, evt) -- 检测config_id为4001的gadget是否从GadgetState.GearStart变为GadgetState.GearStop if 4001 ~= evt.param2 or GadgetState.GearStop ~= evt.param1 or GadgetState.GearStart ~= evt.param3 then return false end return true end -- 触发操作 function action_EVENT_GADGET_STATE_CHANGE_4011(context, evt) -- 改变指定group组240048004中, configid为4006的gadget的state if 0 ~= ScriptLib.SetGroupGadgetStateByConfigId(context, 240048004, 4006, GadgetState.Action01) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_GroupId_ConfigId") return -1 end -- 延迟1.5秒后,向groupId为:240048004的对象,请求一次调用,并将string参数:"time1" 传递过去 if 0 ~= ScriptLib.CreateGroupTimerEvent(context, 240048004, "time1", 1.5) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_timerevent_by_group") return -1 end return 0 end -- 触发条件 function condition_EVENT_SELECT_OPTION_4012(context, evt) -- 判断是gadgetid 4007 option_id 1 if 4007 ~= evt.param1 then return false end if 1 ~= evt.param2 then return false end return true end -- 触发操作 function action_EVENT_SELECT_OPTION_4012(context, evt) -- 改变指定group组240048004中, configid为4001的gadget的state if 0 ~= ScriptLib.SetGroupGadgetStateByConfigId(context, 240048004, 4001, GadgetState.GearAction2) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_GroupId_ConfigId") return -1 end -- 将configid为 4003 的物件更改为状态 GadgetState.GearStop if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 4003, GadgetState.GearStop) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId") return -1 end -- 删除suite2的所有内容 ScriptLib.RemoveExtraGroupSuite(context, 240048006, 2) -- 添加suite3的新内容 ScriptLib.AddExtraGroupSuite(context, 240048006, 3) -- 将configid为 4006 的物件更改为状态 GadgetState.GearStop if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 4006, GadgetState.GearStop) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId") return -1 end -- 将configid为 4005 的物件更改为状态 GadgetState.GearStop if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 4005, GadgetState.GearStop) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId") return -1 end -- 删除指定group: 240048004 ;指定config:4007;物件身上指定option:1; if 0 ~= ScriptLib.DelWorktopOptionByGroupId(context, 240048004, 4007, 1) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : del_work_options_by_group_configId") return -1 end return 0 end