175 lines
5.8 KiB
Go
175 lines
5.8 KiB
Go
-- 基础信息
|
|
local base_info = {
|
|
group_id = 155007074
|
|
}
|
|
|
|
-- Trigger变量
|
|
local defs = {
|
|
max_gear = 4,
|
|
timer = 10,
|
|
group_id = 155007074,
|
|
gadget_1 = 74001,
|
|
gadget_2 = 74002,
|
|
gadget_3 = 74003,
|
|
gadget_4 = 74005,
|
|
gadget_chest = 74004
|
|
}
|
|
|
|
--================================================================
|
|
--
|
|
-- 配置
|
|
--
|
|
--================================================================
|
|
|
|
-- 怪物
|
|
monsters = {
|
|
}
|
|
|
|
-- NPC
|
|
npcs = {
|
|
}
|
|
|
|
-- 装置
|
|
gadgets = {
|
|
{ config_id = 74001, gadget_id = 70900008, pos = { x = -430.851, y = 208.460, z = 1612.807 }, rot = { x = 354.488, y = 332.250, z = 343.385 }, level = 36, state = GadgetState.Action01, persistent = true, area_id = 200 },
|
|
{ config_id = 74002, gadget_id = 70900008, pos = { x = -421.102, y = 204.712, z = 1616.235 }, rot = { x = 348.327, y = 303.499, z = 350.824 }, level = 36, state = GadgetState.Action01, persistent = true, area_id = 200 },
|
|
{ config_id = 74003, gadget_id = 70900008, pos = { x = -420.661, y = 204.925, z = 1607.349 }, rot = { x = 13.463, y = 56.803, z = 342.355 }, level = 36, state = GadgetState.Action01, persistent = true, area_id = 200 },
|
|
{ config_id = 74004, gadget_id = 70211101, pos = { x = -425.192, y = 206.408, z = 1608.066 }, rot = { x = 350.338, y = 325.794, z = 339.662 }, level = 26, drop_tag = "解谜低级稻妻", showcutscene = true, isOneoff = true, persistent = true, explore = { name = "chest", exp = 1 }, area_id = 200 },
|
|
{ config_id = 74005, gadget_id = 70900008, pos = { x = -428.914, y = 207.595, z = 1601.545 }, rot = { x = 354.533, y = 2.101, z = 341.205 }, level = 36, state = GadgetState.Action01, persistent = true, area_id = 200 }
|
|
}
|
|
|
|
-- 区域
|
|
regions = {
|
|
}
|
|
|
|
-- 触发器
|
|
triggers = {
|
|
{ config_id = 1074006, name = "GADGET_STATE_CHANGE_74006", event = EventType.EVENT_GADGET_STATE_CHANGE, source = "", condition = "condition_EVENT_GADGET_STATE_CHANGE_74006", action = "action_EVENT_GADGET_STATE_CHANGE_74006", trigger_count = 0 },
|
|
{ config_id = 1074007, name = "TIMER_EVENT_74007", event = EventType.EVENT_TIMER_EVENT, source = "", condition = "condition_EVENT_TIMER_EVENT_74007", action = "action_EVENT_TIMER_EVENT_74007", trigger_count = 0 },
|
|
{ config_id = 1074008, name = "VARIABLE_CHANGE_74008", event = EventType.EVENT_VARIABLE_CHANGE, source = "", condition = "condition_EVENT_VARIABLE_CHANGE_74008", action = "action_EVENT_VARIABLE_CHANGE_74008", trigger_count = 0 }
|
|
}
|
|
|
|
-- 变量
|
|
variables = {
|
|
{ config_id = 1, name = "active_count", value = 0, no_refresh = false }
|
|
}
|
|
|
|
--================================================================
|
|
--
|
|
-- 初始化配置
|
|
--
|
|
--================================================================
|
|
|
|
-- 初始化时创建
|
|
init_config = {
|
|
suite = 1,
|
|
end_suite = 0,
|
|
rand_suite = false
|
|
}
|
|
|
|
--================================================================
|
|
--
|
|
-- 小组配置
|
|
--
|
|
--================================================================
|
|
|
|
suites = {
|
|
{
|
|
-- suite_id = 1,
|
|
-- description = suite_1,
|
|
monsters = { },
|
|
gadgets = { 74001, 74002, 74003, 74005 },
|
|
regions = { },
|
|
triggers = { "GADGET_STATE_CHANGE_74006", "TIMER_EVENT_74007", "VARIABLE_CHANGE_74008" },
|
|
rand_weight = 100
|
|
}
|
|
}
|
|
|
|
--================================================================
|
|
--
|
|
-- 触发器
|
|
--
|
|
--================================================================
|
|
|
|
-- 触发条件
|
|
function condition_EVENT_GADGET_STATE_CHANGE_74006(context, evt)
|
|
if defs.gadget_1 ~= evt.param2 and defs.gadget_2 ~= evt.param2 and defs.gadget_3 ~= evt.param2 and defs.gadget_4 ~= evt.param2 then
|
|
return false
|
|
end
|
|
return true
|
|
end
|
|
|
|
-- 触发操作
|
|
function action_EVENT_GADGET_STATE_CHANGE_74006(context, evt)
|
|
if 0 == ScriptLib.GetGroupVariableValue(context, "active_count") then
|
|
ScriptLib.MarkPlayerAction(context, 1001, 1, 1)
|
|
end
|
|
if evt.param1 == GadgetState.Action01 then
|
|
ScriptLib.ChangeGroupVariableValue(context, "active_count", -1)
|
|
elseif evt.param1 == GadgetState.Action02 then
|
|
ScriptLib.ChangeGroupVariableValue(context, "active_count", 1)
|
|
ScriptLib.CreateGroupTimerEvent(context, defs.group_id, tostring(evt.param2), defs.timer)
|
|
else
|
|
return -1
|
|
end
|
|
return 0
|
|
end
|
|
|
|
-- 触发条件
|
|
function condition_EVENT_TIMER_EVENT_74007(context, evt)
|
|
if evt.source_name ~= tostring(defs.gadget_1) and evt.source_name ~= tostring(defs.gadget_2) and evt.source_name ~= tostring(defs.gadget_3) and evt.source_name ~= tostring(defs.gadget_4) then
|
|
return false
|
|
end
|
|
return true
|
|
end
|
|
|
|
-- 触发操作
|
|
function action_EVENT_TIMER_EVENT_74007(context, evt)
|
|
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, tonumber(evt.source_name), GadgetState.Action01) then
|
|
return -1
|
|
end
|
|
return 0
|
|
end
|
|
|
|
-- 触发条件
|
|
function condition_EVENT_VARIABLE_CHANGE_74008(context, evt)
|
|
if evt.param1 == evt.param2 then return false end
|
|
|
|
if evt.param1 == -1 then
|
|
ScriptLib.MarkPlayerAction(context, 1001, 4, 1)
|
|
end
|
|
if evt.param1 ~= defs.max_gear then
|
|
return false
|
|
end
|
|
return true
|
|
end
|
|
|
|
-- 触发操作
|
|
function action_EVENT_VARIABLE_CHANGE_74008(context, evt)
|
|
ScriptLib.CancelGroupTimerEvent(context, defs.group_id, tostring(defs.gadget_1))
|
|
ScriptLib.CancelGroupTimerEvent(context, defs.group_id, tostring(defs.gadget_2))
|
|
ScriptLib.CancelGroupTimerEvent(context, defs.group_id, tostring(defs.gadget_3))
|
|
ScriptLib.CancelGroupTimerEvent(context, defs.group_id, tostring(defs.gadget_4))
|
|
|
|
if defs.gadget_1 ~= 0 then
|
|
ScriptLib.SetGadgetStateByConfigId(context, defs.gadget_1, GadgetState.GearStart)
|
|
end
|
|
|
|
if defs.gadget_2 ~= 0 then
|
|
ScriptLib.SetGadgetStateByConfigId(context, defs.gadget_2, GadgetState.GearStart)
|
|
end
|
|
|
|
if defs.gadget_3 ~=0 then
|
|
ScriptLib.SetGadgetStateByConfigId(context, defs.gadget_3, GadgetState.GearStart)
|
|
end
|
|
|
|
if defs.gadget_4 ~=0 then
|
|
ScriptLib.SetGadgetStateByConfigId(context, defs.gadget_4, GadgetState.GearStart)
|
|
end
|
|
|
|
if ScriptLib.CreateGadget(context, { config_id = defs.gadget_chest }) ~= 0 then
|
|
return -1
|
|
end
|
|
ScriptLib.MarkPlayerAction(context, 1001, 3, 1)
|
|
return 0
|
|
end |