175 lines
4.4 KiB
Go
175 lines
4.4 KiB
Go
-- 基础信息
|
|
local base_info = {
|
|
group_id = 155008012
|
|
}
|
|
|
|
-- Trigger变量
|
|
local defs = {
|
|
group_ID = 155008012,
|
|
altarGroupID = 155008010
|
|
}
|
|
|
|
-- 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)
|
|
ScriptLib.AddQuestProgress(context,"72191_OpenChamber")
|
|
|
|
|
|
end,
|
|
["2"] = function(context)
|
|
--ScriptLib.SetGroupVariableValue(context,"is_daynight_finish",1)
|
|
ScriptLib.AddExtraGroupSuite(context, defs.group_ID, 3)
|
|
ScriptLib.AddQuestProgress(context,"72191_OpenChamber")
|
|
ScriptLib.AddQuestProgress(context,"72191_QuestFinish")
|
|
end
|
|
|
|
}
|
|
|
|
|
|
function UpdateGamePlayState(context)
|
|
local state = ScriptLib.GetGroupVariableValue(context, "gameplayState")
|
|
|
|
gameplayStateFuncitons[tostring(state)](context)
|
|
|
|
end
|
|
|
|
--================================================================
|
|
--
|
|
-- 配置
|
|
--
|
|
--================================================================
|
|
|
|
-- 怪物
|
|
monsters = {
|
|
}
|
|
|
|
-- NPC
|
|
npcs = {
|
|
}
|
|
|
|
-- 装置
|
|
gadgets = {
|
|
-- 祭坛第一密室宝箱,产出主线任务碎片
|
|
{ config_id = 12001, gadget_id = 70211111, pos = { x = -145.208, y = 264.190, z = 430.345 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 16, drop_tag = "解谜中级稻妻", isOneoff = true, persistent = true, explore = { name = "chest", exp = 1 }, area_id = 200 }
|
|
}
|
|
|
|
-- 区域
|
|
regions = {
|
|
}
|
|
|
|
-- 触发器
|
|
triggers = {
|
|
{ config_id = 1012002, name = "GADGET_STATE_CHANGE_12002", event = EventType.EVENT_GADGET_STATE_CHANGE, source = "", condition = "condition_EVENT_GADGET_STATE_CHANGE_12002", action = "action_EVENT_GADGET_STATE_CHANGE_12002", trigger_count = 0 },
|
|
-- 初始化
|
|
{ config_id = 1012003, name = "GROUP_LOAD_12003", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_EVENT_GROUP_LOAD_12003", trigger_count = 0 },
|
|
-- 监听gameplayState
|
|
{ config_id = 1012004, name = "VARIABLE_CHANGE_12004", event = EventType.EVENT_VARIABLE_CHANGE, source = "gameplayState", condition = "", action = "action_EVENT_VARIABLE_CHANGE_12004", trigger_count = 0 }
|
|
}
|
|
|
|
-- 变量
|
|
variables = {
|
|
{ config_id = 1, name = "gameplayState", value = 0, no_refresh = true }
|
|
}
|
|
|
|
--================================================================
|
|
--
|
|
-- 初始化配置
|
|
--
|
|
--================================================================
|
|
|
|
-- 初始化时创建
|
|
init_config = {
|
|
suite = 1,
|
|
end_suite = 0,
|
|
rand_suite = false
|
|
}
|
|
|
|
--================================================================
|
|
--
|
|
-- 小组配置
|
|
--
|
|
--================================================================
|
|
|
|
suites = {
|
|
{
|
|
-- suite_id = 1,
|
|
-- description = ,
|
|
monsters = { },
|
|
gadgets = { },
|
|
regions = { },
|
|
triggers = { "GROUP_LOAD_12003", "VARIABLE_CHANGE_12004" },
|
|
rand_weight = 100
|
|
},
|
|
{
|
|
-- suite_id = 2,
|
|
-- description = ,
|
|
monsters = { },
|
|
gadgets = { 12001 },
|
|
regions = { },
|
|
triggers = { "GADGET_STATE_CHANGE_12002" },
|
|
rand_weight = 100
|
|
},
|
|
{
|
|
-- suite_id = 3,
|
|
-- description = ,
|
|
monsters = { },
|
|
gadgets = { },
|
|
regions = { },
|
|
triggers = { },
|
|
rand_weight = 100
|
|
}
|
|
}
|
|
|
|
--================================================================
|
|
--
|
|
-- 触发器
|
|
--
|
|
--================================================================
|
|
|
|
-- 触发条件
|
|
function condition_EVENT_GADGET_STATE_CHANGE_12002(context, evt)
|
|
if GadgetState.ChestOpened ~= ScriptLib.GetGadgetStateByConfigId(context, 155008012, 12001) then
|
|
return false
|
|
end
|
|
|
|
return true
|
|
end
|
|
|
|
-- 触发操作
|
|
function action_EVENT_GADGET_STATE_CHANGE_12002(context, evt)
|
|
-- 将本组内变量名为 "solution_state_1" 的变量设置为 3
|
|
if 0 ~= ScriptLib.SetGroupVariableValueByGroup(context, "solution_state_1", 3, 155008010) then
|
|
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_groupVariable_by_group")
|
|
return -1
|
|
end
|
|
|
|
-- 将本组内变量名为 "gameplayState" 的变量设置为 2
|
|
if 0 ~= ScriptLib.SetGroupVariableValue(context, "gameplayState", 2) then
|
|
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_groupVariable")
|
|
return -1
|
|
end
|
|
|
|
return 0
|
|
end
|
|
|
|
-- 触发操作
|
|
function action_EVENT_GROUP_LOAD_12003(context, evt)
|
|
UpdateGamePlayState(context)
|
|
return 0
|
|
end
|
|
|
|
-- 触发操作
|
|
function action_EVENT_VARIABLE_CHANGE_12004(context, evt)
|
|
if evt.param1 == evt.param2 then return -1 end
|
|
|
|
UpdateGamePlayState(context)
|
|
return 0
|
|
end |