-- 基础信息 local base_info = { group_id = 155006090 } -- Trigger变量 local defs = { group_ID = 155006090 } -- DEFS_MISCS local gameplayStateFuncitons = { ["0"] = function(context) ScriptLib.SetGroupVariableValue(context,"is_daynight_finish",1) end, ["1"] = function(context) ScriptLib.SetGroupVariableValue(context,"is_daynight_finish",0) ScriptLib.AddExtraGroupSuite(context, defs.group_ID, 2) end, ["2"] = function(context) ScriptLib.SetGroupVariableValue(context,"is_daynight_finish",1) ScriptLib.AddExtraGroupSuite(context, defs.group_ID, 3) end } function UpdateGamePlayState(context) local state = ScriptLib.GetGroupVariableValue(context, "gameplayState") gameplayStateFuncitons[tostring(state)](context) end --================================================================ -- -- 配置 -- --================================================================ -- 怪物 monsters = { } -- NPC npcs = { } -- 装置 gadgets = { { config_id = 90011, gadget_id = 70211111, pos = { x = 521.745, y = 177.035, z = -457.819 }, rot = { x = 0.000, y = 340.114, z = 0.000 }, level = 16, drop_tag = "解谜中级稻妻", isOneoff = true, persistent = true, explore = { name = "chest", exp = 1 }, area_id = 200 } } -- 区域 regions = { } -- 触发器 triggers = { -- 初始化 { config_id = 1090001, name = "GROUP_LOAD_90001", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_EVENT_GROUP_LOAD_90001", trigger_count = 0 }, -- 监听gameplayState变化 { config_id = 1090002, name = "VARIABLE_CHANGE_90002", event = EventType.EVENT_VARIABLE_CHANGE, source = "gameplayState", condition = "", action = "action_EVENT_VARIABLE_CHANGE_90002", trigger_count = 0 }, { config_id = 1090010, name = "VARIABLE_CHANGE_90010", event = EventType.EVENT_VARIABLE_CHANGE, source = "activecount", condition = "condition_EVENT_VARIABLE_CHANGE_90010", action = "action_EVENT_VARIABLE_CHANGE_90010", trigger_count = 0 } } -- 变量 variables = { { config_id = 1, name = "gameplayState", value = 0, no_refresh = true }, { config_id = 2, name = "activecount", value = 0, no_refresh = true } } -- 废弃数据 garbages = { gadgets = { { config_id = 90003, gadget_id = 70220008, pos = { x = 520.317, y = 178.020, z = -463.154 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 36, isOneoff = true, persistent = true, area_id = 200 }, { config_id = 90004, gadget_id = 70220008, pos = { x = 523.341, y = 178.233, z = -465.781 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 36, isOneoff = true, persistent = true, area_id = 200 }, { config_id = 90005, gadget_id = 70220008, pos = { x = 520.013, y = 177.601, z = -467.563 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 36, isOneoff = true, persistent = true, area_id = 200 }, { config_id = 90006, gadget_id = 70290217, pos = { x = 520.305, y = 179.514, z = -463.108 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 36, area_id = 200 }, { config_id = 90007, gadget_id = 70290217, pos = { x = 523.442, y = 179.487, z = -465.664 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 36, area_id = 200 }, { config_id = 90008, gadget_id = 70290217, pos = { x = 520.122, y = 178.906, z = -467.580 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 36, area_id = 200 } }, triggers = { { config_id = 1090009, name = "ANY_GADGET_DIE_90009", event = EventType.EVENT_ANY_GADGET_DIE, source = "", condition = "", action = "action_EVENT_ANY_GADGET_DIE_90009", trigger_count = 0 } } } --================================================================ -- -- 初始化配置 -- --================================================================ -- 初始化时创建 init_config = { suite = 1, end_suite = 0, rand_suite = false } --================================================================ -- -- 小组配置 -- --================================================================ suites = { { -- suite_id = 1, -- description = 静态逻辑, monsters = { }, gadgets = { }, regions = { }, triggers = { "GROUP_LOAD_90001", "VARIABLE_CHANGE_90002", "VARIABLE_CHANGE_90010" }, rand_weight = 100 }, { -- suite_id = 2, -- description = 玩法开启, monsters = { }, gadgets = { 90011 }, regions = { }, triggers = { }, rand_weight = 100 }, { -- suite_id = 3, -- description = 玩法完成, monsters = { }, gadgets = { }, regions = { }, triggers = { }, rand_weight = 100 } } --================================================================ -- -- 触发器 -- --================================================================ -- 触发操作 function action_EVENT_GROUP_LOAD_90001(context, evt) UpdateGamePlayState(context) return 0 end -- 触发操作 function action_EVENT_VARIABLE_CHANGE_90002(context, evt) if evt.param1 == evt.param2 then return -1 end UpdateGamePlayState(context) return 0 end -- 触发条件 function condition_EVENT_VARIABLE_CHANGE_90010(context, evt) if evt.param1 == evt.param2 then return false end -- 判断变量"activecount"为3 if ScriptLib.GetGroupVariableValue(context, "activecount") ~= 3 then return false end return true end -- 触发操作 function action_EVENT_VARIABLE_CHANGE_90010(context, evt) -- 将本组内变量名为 "gameplayState" 的变量设置为 1 if 0 ~= ScriptLib.SetGroupVariableValue(context, "gameplayState", 1) then ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_groupVariable") return -1 end return 0 end