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

201 lines
5.4 KiB
Lua

-- 基础信息
local base_info = {
group_id = 155009030
}
-- Trigger变量
local defs = {
group_ID = 155009030,
managerGroup = 155009001
}
-- DEFS_MISCS
local gameplayStateFuncitons =
{
["0"] = function(context)
end,
["1"] = function(context)
ScriptLib.AddExtraGroupSuite(context,defs.group_ID, 2)
ScriptLib.GoToGroupSuite(context, defs.group_ID, 2)
ScriptLib.PrintContextLog(context, " add suit 2")
end,
["2"] = function(context)
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 = 30001, gadget_id = 70500000, pos = { x = -739.479, y = 160.415, z = -172.832 }, rot = { x = 0.000, y = 87.312, z = 0.000 }, level = 36, point_type = 4009, isOneoff = true, persistent = true, area_id = 200 },
{ config_id = 30002, gadget_id = 70500000, pos = { x = -841.160, y = 162.753, z = -219.590 }, rot = { x = 0.000, y = 100.798, z = 0.000 }, level = 36, point_type = 4011, isOneoff = true, persistent = true, area_id = 200 }
}
-- 区域
regions = {
}
-- 触发器
triggers = {
{ config_id = 1030004, name = "GROUP_LOAD_30004", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "", action = "action_EVENT_GROUP_LOAD_30004", trigger_count = 0 },
{ config_id = 1030005, name = "VARIABLE_CHANGE_30005", event = EventType.EVENT_VARIABLE_CHANGE, source = "gameplayState", condition = "condition_EVENT_VARIABLE_CHANGE_30005", action = "action_EVENT_VARIABLE_CHANGE_30005", trigger_count = 0 },
{ config_id = 1030006, name = "GATHER_30006", event = EventType.EVENT_GATHER, source = "", condition = "", action = "action_EVENT_GATHER_30006", trigger_count = 0 },
{ config_id = 1030007, name = "VARIABLE_CHANGE_30007", event = EventType.EVENT_VARIABLE_CHANGE, source = "count", condition = "condition_EVENT_VARIABLE_CHANGE_30007", action = "action_EVENT_VARIABLE_CHANGE_30007", trigger_count = 0 }
}
-- 变量
variables = {
{ config_id = 1, name = "gameplayState", value = 0, no_refresh = true },
{ config_id = 2, name = "isfinished", value = 0, no_refresh = true },
{ config_id = 3, name = "count", value = 0, no_refresh = true }
}
-- 废弃数据
garbages = {
gadgets = {
{ config_id = 30003, gadget_id = 70500000, pos = { x = -717.358, y = 149.071, z = -245.418 }, rot = { x = 0.000, y = 149.959, z = 0.000 }, level = 36, point_type = 4011, isOneoff = true, persistent = true, area_id = 200 }
}
}
--================================================================
--
-- 初始化配置
--
--================================================================
-- 初始化时创建
init_config = {
suite = 1,
end_suite = 2,
rand_suite = false
}
--================================================================
--
-- 小组配置
--
--================================================================
suites = {
{
-- suite_id = 1,
-- description = ,
monsters = { },
gadgets = { },
regions = { },
triggers = { "GROUP_LOAD_30004", "VARIABLE_CHANGE_30005" },
rand_weight = 100
},
{
-- suite_id = 2,
-- description = ,
monsters = { },
gadgets = { 30001, 30002 },
regions = { },
triggers = { "GATHER_30006", "VARIABLE_CHANGE_30007" },
rand_weight = 100
}
}
--================================================================
--
-- 触发器
--
--================================================================
-- 触发操作
function action_EVENT_GROUP_LOAD_30004(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_30005(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_30005(context, evt)
UpdateGamePlayState(context)
return 0
end
-- 触发操作
function action_EVENT_GATHER_30006(context, evt)
-- 针对当前group内变量名为 "count" 的变量,进行修改,变化值为 1
if 0 ~= ScriptLib.ChangeGroupVariableValue(context, "count", 1) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : change_GroupVariable")
return -1
end
return 0
end
-- 触发条件
function condition_EVENT_VARIABLE_CHANGE_30007(context, evt)
if evt.param1 == evt.param2 then return false end
-- 判断变量"count"为2
if ScriptLib.GetGroupVariableValue(context, "count") ~= 2 then
return false
end
return true
end
-- 触发操作
function action_EVENT_VARIABLE_CHANGE_30007(context, evt)
-- 将本组内变量名为 "isfinished" 的变量设置为 1
if 0 ~= ScriptLib.SetGroupVariableValue(context, "isfinished", 1) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_groupVariable")
return -1
end
return 0
end