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

163 lines
6.0 KiB
Go

-- 基础信息
local base_info = {
group_id = 144001199
}
-- Trigger变量
local defs = {
group_id = 144001199,
gadget_riddle_hint = 199001,
gadget_riddle_1 = 199002,
gadget_riddle_2 = 199003,
gadget_riddle_3 = 199004,
gadget_riddle_4 = 199005,
gadget_chest = 199006
}
--================================================================
--
-- 配置
--
--================================================================
-- 怪物
monsters = {
}
-- NPC
npcs = {
}
-- 装置
gadgets = {
{ config_id = 199001, gadget_id = 70310012, pos = { x = -719.213, y = 119.967, z = 408.656 }, rot = { x = 357.456, y = 139.600, z = 2.030 }, level = 20, persistent = true, area_id = 103 },
{ config_id = 199002, gadget_id = 70310011, pos = { x = -730.026, y = 115.723, z = 397.316 }, rot = { x = 0.000, y = 276.100, z = 0.000 }, level = 20, persistent = true, area_id = 103 },
{ config_id = 199003, gadget_id = 70310011, pos = { x = -710.258, y = 131.018, z = 398.160 }, rot = { x = 4.469, y = 317.500, z = 357.005 }, level = 20, persistent = true, area_id = 103 },
{ config_id = 199004, gadget_id = 70310011, pos = { x = -710.674, y = 122.481, z = 415.770 }, rot = { x = 0.000, y = 257.600, z = 0.000 }, level = 20, persistent = true, area_id = 103 },
{ config_id = 199005, gadget_id = 70310011, pos = { x = -728.472, y = 123.438, z = 419.213 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 20, persistent = true, area_id = 103 },
{ config_id = 199006, gadget_id = 70211112, pos = { x = -719.186, y = 120.415, z = 408.696 }, rot = { x = 358.732, y = 245.298, z = 357.002 }, level = 16, drop_tag = "解谜中级群岛", state = GadgetState.ChestLocked, isOneoff = true, persistent = true, explore = { name = "chest", exp = 1 }, area_id = 103 }
}
-- 区域
regions = {
}
-- 触发器
triggers = {
{ config_id = 1199007, name = "GADGET_STATE_CHANGE_199007", event = EventType.EVENT_GADGET_STATE_CHANGE, source = "", condition = "condition_EVENT_GADGET_STATE_CHANGE_199007", action = "action_EVENT_GADGET_STATE_CHANGE_199007", trigger_count = 0 },
{ config_id = 1199008, name = "VARIABLE_CHANGE_199008", event = EventType.EVENT_VARIABLE_CHANGE, source = "State_Flag", condition = "condition_EVENT_VARIABLE_CHANGE_199008", action = "action_EVENT_VARIABLE_CHANGE_199008", trigger_count = 0 },
{ config_id = 1199009, name = "GROUP_LOAD_199009", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_EVENT_GROUP_LOAD_199009", trigger_count = 0 }
}
-- 变量
variables = {
{ config_id = 1, name = "State_Flag", value = 0, no_refresh = true }
}
--================================================================
--
-- 初始化配置
--
--================================================================
-- 初始化时创建
init_config = {
suite = 1,
end_suite = 0,
rand_suite = false
}
--================================================================
--
-- 小组配置
--
--================================================================
suites = {
{
-- suite_id = 1,
-- description = suite_1,
monsters = { },
gadgets = { 199001, 199002, 199003, 199004, 199005, 199006 },
regions = { },
triggers = { "GADGET_STATE_CHANGE_199007", "VARIABLE_CHANGE_199008", "GROUP_LOAD_199009" },
rand_weight = 100
}
}
--================================================================
--
-- 触发器
--
--================================================================
-- 触发条件
function condition_EVENT_GADGET_STATE_CHANGE_199007(context, evt)
if evt.param2 ~= defs.gadget_riddle_1 and evt.param2 ~= defs.gadget_riddle_2 and evt.param2 ~= defs.gadget_riddle_3 and evt.param2 ~= defs.gadget_riddle_4 then
return false
end
return true
end
-- 触发操作
function action_EVENT_GADGET_STATE_CHANGE_199007(context, evt)
if evt.param1 == GadgetState.GearStart then
ScriptLib.ChangeGroupVariableValue(context, "State_Flag", 1)
if 0 == ScriptLib.GetCurTriggerCount(context) then
ScriptLib.MarkPlayerAction(context, 1003, 1, 1)
end
elseif evt.param1 == GadgetState.Default then
ScriptLib.ChangeGroupVariableValue(context, "State_Flag", -1)
end
return 0
end
-- 触发条件
function condition_EVENT_VARIABLE_CHANGE_199008(context, evt)
if evt.param1 == evt.param2 then return false end
if evt.param1 < 0 or evt.param1 > 4 then
return false
end
return true
end
-- 触发操作
function action_EVENT_VARIABLE_CHANGE_199008(context, evt)
if evt.param1 == 0 then
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, defs.gadget_riddle_hint, GadgetState.Default)
elseif evt.param1 == 1 then
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, defs.gadget_riddle_hint, GadgetState.Action01)
ScriptLib.MarkPlayerAction(context, 1003, 2, 2)
elseif evt.param1 == 2 then
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, defs.gadget_riddle_hint, GadgetState.Action02)
ScriptLib.MarkPlayerAction(context, 1003, 2, 3)
elseif evt.param1 == 3 then
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, defs.gadget_riddle_hint, GadgetState.Action03)
ScriptLib.MarkPlayerAction(context, 1003, 2, 4)
elseif evt.param1 == 4 then
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, defs.gadget_riddle_hint, GadgetState.GearStart)
ScriptLib.MarkPlayerAction(context, 1003, 3, 5)
ScriptLib.SetGroupGadgetStateByConfigId(context, defs.group_id, defs.gadget_chest, GadgetState.Default)
end
return 0
end
-- 触发操作
function action_EVENT_GROUP_LOAD_199009(context, evt)
local sum = 0
if ScriptLib.GetGadgetStateByConfigId(context, defs.group_id, defs.gadget_riddle_1) == GadgetState.GearStart then
sum = sum + 1
end
if ScriptLib.GetGadgetStateByConfigId(context, defs.group_id, defs.gadget_riddle_2) == GadgetState.GearStart then
sum = sum + 1
end
if ScriptLib.GetGadgetStateByConfigId(context, defs.group_id, defs.gadget_riddle_3) == GadgetState.GearStart then
sum = sum + 1
end
if ScriptLib.GetGadgetStateByConfigId(context, defs.group_id, defs.gadget_riddle_4) == GadgetState.GearStart then
sum = sum + 1
end
ScriptLib.SetGroupVariableValue(context, "State_Flag", sum)
return 0
end