166 lines
4.2 KiB
Go
166 lines
4.2 KiB
Go
-- 基础信息
|
|
local base_info = {
|
|
group_id = 155003032
|
|
}
|
|
|
|
-- Trigger变量
|
|
local defs = {
|
|
group_ID = 155003032,
|
|
managerGroup = 155003001
|
|
}
|
|
|
|
-- DEFS_MISCS
|
|
local Controllers = {}
|
|
local EnvControlGadgets = {}
|
|
local Worktops = {}
|
|
local DayAppearGadgets = {}
|
|
local NightAppearGadgets = {}
|
|
|
|
|
|
local gameplayStateFuncitons =
|
|
{
|
|
["0"] = function(context)
|
|
ScriptLib.SetGroupVariableValue(context,"is_daynight_finish",1)
|
|
|
|
end,
|
|
["1"] = function(context)
|
|
|
|
ScriptLib.SetGroupVariableValue(context,"is_daynight_finish",0)
|
|
ScriptLib.RefreshGroup(context, { group_id = defs.group_ID, suite = 2 })
|
|
ScriptLib.PrintContextLog(context, " add suit 2")
|
|
|
|
|
|
end,
|
|
["2"] = function(context)
|
|
|
|
ScriptLib.SetGroupVariableValue(context,"is_daynight_finish",1)
|
|
ScriptLib.AddExtraGroupSuite(context, defs.group_ID, 2)
|
|
|
|
|
|
end
|
|
}
|
|
|
|
|
|
function UpdateGamePlayState(context)
|
|
local state = ScriptLib.GetGroupVariableValue(context, "gameplayState")
|
|
ScriptLib.PrintContextLog(context, "update gameplay state")
|
|
gameplayStateFuncitons[tostring(state)](context)
|
|
|
|
end
|
|
|
|
--================================================================
|
|
--
|
|
-- 配置
|
|
--
|
|
--================================================================
|
|
|
|
-- 怪物
|
|
monsters = {
|
|
}
|
|
|
|
-- NPC
|
|
npcs = {
|
|
}
|
|
|
|
-- 装置
|
|
gadgets = {
|
|
{ config_id = 32001, gadget_id = 70500000, pos = { x = 1332.858, y = 258.013, z = -666.242 }, rot = { x = 3.792, y = 135.537, z = 357.932 }, level = 36, point_type = 1008, persistent = true, area_id = 200 },
|
|
{ config_id = 32002, gadget_id = 70500000, pos = { x = 1334.062, y = 257.710, z = -667.625 }, rot = { x = 20.074, y = 141.865, z = 49.426 }, level = 36, point_type = 1008, persistent = true, area_id = 200 },
|
|
{ config_id = 32003, gadget_id = 70500000, pos = { x = 1328.819, y = 261.558, z = -661.422 }, rot = { x = 338.037, y = 95.782, z = 22.949 }, level = 36, point_type = 1008, persistent = true, area_id = 200 }
|
|
}
|
|
|
|
-- 区域
|
|
regions = {
|
|
}
|
|
|
|
-- 触发器
|
|
triggers = {
|
|
{ config_id = 1032005, name = "GROUP_LOAD_32005", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_EVENT_GROUP_LOAD_32005", trigger_count = 0 },
|
|
{ config_id = 1032006, name = "VARIABLE_CHANGE_32006", event = EventType.EVENT_VARIABLE_CHANGE, source = "gameplayState", condition = "condition_EVENT_VARIABLE_CHANGE_32006", action = "action_EVENT_VARIABLE_CHANGE_32006", trigger_count = 0 }
|
|
}
|
|
|
|
-- 变量
|
|
variables = {
|
|
{ config_id = 1, name = "gameplayState", value = 0, no_refresh = true }
|
|
}
|
|
|
|
--================================================================
|
|
--
|
|
-- 初始化配置
|
|
--
|
|
--================================================================
|
|
|
|
-- 初始化时创建
|
|
init_config = {
|
|
suite = 1,
|
|
end_suite = 2,
|
|
rand_suite = false
|
|
}
|
|
|
|
--================================================================
|
|
--
|
|
-- 小组配置
|
|
--
|
|
--================================================================
|
|
|
|
suites = {
|
|
{
|
|
-- suite_id = 1,
|
|
-- description = ,
|
|
monsters = { },
|
|
gadgets = { },
|
|
regions = { },
|
|
triggers = { "GROUP_LOAD_32005", "VARIABLE_CHANGE_32006" },
|
|
rand_weight = 100
|
|
},
|
|
{
|
|
-- suite_id = 2,
|
|
-- description = ,
|
|
monsters = { },
|
|
gadgets = { 32001, 32002, 32003 },
|
|
regions = { },
|
|
triggers = { },
|
|
rand_weight = 100
|
|
}
|
|
}
|
|
|
|
--================================================================
|
|
--
|
|
-- 触发器
|
|
--
|
|
--================================================================
|
|
|
|
-- 触发操作
|
|
function action_EVENT_GROUP_LOAD_32005(context, evt)
|
|
local isactive = ScriptLib.GetGroupVariableValueByGroup(context, "IslandActive", defs.managerGroup)
|
|
|
|
if isactive == 1 then
|
|
if ScriptLib.GetGroupVariableValue(context,"gameplayState") == 0 then
|
|
ScriptLib.SetGroupVariableValue(context,"gameplayState", 1)
|
|
end
|
|
|
|
end
|
|
UpdateGamePlayState(context)
|
|
return 0
|
|
end
|
|
|
|
-- 触发条件
|
|
function condition_EVENT_VARIABLE_CHANGE_32006(context, evt)
|
|
if evt.param1 == evt.param2 then return false end
|
|
|
|
-- 判断变量"gameplayState"为0
|
|
if ScriptLib.GetGroupVariableValue(context, "gameplayState") == 0 then
|
|
return false
|
|
end
|
|
|
|
return true
|
|
end
|
|
|
|
-- 触发操作
|
|
function action_EVENT_VARIABLE_CHANGE_32006(context, evt)
|
|
UpdateGamePlayState(context)
|
|
return 0
|
|
end
|
|
|
|
require "V2_4/EnvState"
|
|
require "V2_4/EnvStateWorktop" |