Files
hk4e-go/gdconf/game_data_config/lua/scene/5/scene5_group155006029.lua
T
2022-11-30 00:00:20 +08:00

187 lines
4.7 KiB
Go

-- 基础信息
local base_info = {
group_id = 155006029
}
-- Trigger变量
local defs = {
group_ID = 155006029
}
-- DEFS_MISCS
local gameplayStateFuncitons =
{
["0"] = function(context)
end,
["1"] = function(context)
ScriptLib.AddExtraGroupSuite(context, defs.group_ID, 2)
end,
["2"] = function(context)
ScriptLib.AddExtraGroupSuite(context, defs.group_ID, 3)
ScriptLib.SetGroupGadgetStateByConfigId(context, 155006029, 29014, GadgetState.GearStart)
ScriptLib.SetGadgetStateByConfigId(context, 29001, GadgetState.Default)
end,
["3"] = function(context)
ScriptLib.AddExtraGroupSuite(context, defs.group_ID, 4)
ScriptLib.SetGroupGadgetStateByConfigId(context, 155006029, 29014, GadgetState.GearStart)
ScriptLib.AddQuestProgress(context, "72267_MazeSolved")
end
}
function UpdateGamePlayState(context)
local state = ScriptLib.GetGroupVariableValue(context, "gameplayState")
gameplayStateFuncitons[tostring(state)](context)
end
--================================================================
--
-- 配置
--
--================================================================
-- 怪物
monsters = {
}
-- NPC
npcs = {
}
-- 装置
gadgets = {
-- 伊达迷宫宝箱 产出伊达的认可状1
{ config_id = 29001, gadget_id = 70211132, pos = { x = 573.857, y = 132.008, z = -470.274 }, rot = { x = 0.000, y = 270.866, z = 0.000 }, level = 16, chest_drop_id = 2004100, drop_count = 1, state = GadgetState.ChestLocked, isOneoff = true, persistent = true, explore = { name = "chest", exp = 1 }, area_id = 200 },
{ config_id = 29014, gadget_id = 70290281, pos = { x = 573.027, y = 144.208, z = -470.819 }, rot = { x = 270.000, y = 0.000, z = 0.000 }, level = 36, persistent = true, area_id = 200 }
}
-- 区域
regions = {
}
-- 触发器
triggers = {
{ config_id = 1029002, name = "GADGET_STATE_CHANGE_29002", event = EventType.EVENT_GADGET_STATE_CHANGE, source = "", condition = "condition_EVENT_GADGET_STATE_CHANGE_29002", action = "action_EVENT_GADGET_STATE_CHANGE_29002", trigger_count = 0 },
-- 初始化
{ config_id = 1029003, name = "GROUP_LOAD_29003", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_EVENT_GROUP_LOAD_29003", trigger_count = 0 },
-- 监听gameplayState
{ config_id = 1029012, name = "VARIABLE_CHANGE_29012", event = EventType.EVENT_VARIABLE_CHANGE, source = "gameplayState", condition = "", action = "action_EVENT_VARIABLE_CHANGE_29012", trigger_count = 0 }
}
-- 变量
variables = {
{ config_id = 1, name = "gameplayState", value = 1, no_refresh = true }
}
--================================================================
--
-- 初始化配置
--
--================================================================
-- 初始化时创建
init_config = {
suite = 1,
end_suite = 0,
rand_suite = false
}
--================================================================
--
-- 小组配置
--
--================================================================
suites = {
{
-- suite_id = 1,
-- description = ,
monsters = { },
gadgets = { },
regions = { },
triggers = { "GROUP_LOAD_29003", "VARIABLE_CHANGE_29012" },
rand_weight = 100
},
{
-- suite_id = 2,
-- description = ,
monsters = { },
gadgets = { 29001, 29014 },
regions = { },
triggers = { },
rand_weight = 100
},
{
-- suite_id = 3,
-- description = ,
monsters = { },
gadgets = { 29001, 29014 },
regions = { },
triggers = { "GADGET_STATE_CHANGE_29002" },
rand_weight = 100
},
{
-- suite_id = 4,
-- description = ,
monsters = { },
gadgets = { 29014 },
regions = { },
triggers = { },
rand_weight = 100
}
}
--================================================================
--
-- 触发器
--
--================================================================
-- 触发条件
function condition_EVENT_GADGET_STATE_CHANGE_29002(context, evt)
if GadgetState.ChestOpened ~= ScriptLib.GetGadgetStateByConfigId(context, 155006029, 29001) then
return false
end
-- 判断变量"gameplayState"为2
if ScriptLib.GetGroupVariableValue(context, "gameplayState") ~= 2 then
return false
end
return true
end
-- 触发操作
function action_EVENT_GADGET_STATE_CHANGE_29002(context, evt)
-- 将本组内变量名为 "gameplayState" 的变量设置为 3
if 0 ~= ScriptLib.SetGroupVariableValue(context, "gameplayState", 3) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_groupVariable")
return -1
end
return 0
end
-- 触发操作
function action_EVENT_GROUP_LOAD_29003(context, evt)
UpdateGamePlayState(context)
return 0
end
-- 触发操作
function action_EVENT_VARIABLE_CHANGE_29012(context, evt)
if evt.param1 == evt.param2 then return -1 end
UpdateGamePlayState(context)
return 0
end