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

211 lines
6.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- 基础信息
local base_info = {
group_id = 201068004
}
--================================================================
--
-- 配置
--
--================================================================
-- 怪物
monsters = {
}
-- NPC
npcs = {
}
-- 装置
gadgets = {
{ config_id = 4001, gadget_id = 70710668, pos = { x = 1.764, y = 1.155, z = -7.634 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, room = 1 }
}
-- 区域
regions = {
-- variable为3则切suite
{ config_id = 4005, shape = RegionShape.SPHERE, radius = 5, pos = { x = 1.815, y = 0.433, z = -7.440 }, room = 1 }
}
-- 触发器
triggers = {
-- 检查7050303完成
{ config_id = 1004002, name = "QUEST_FINISH_4002", event = EventType.EVENT_QUEST_FINISH, source = "", condition = "condition_EVENT_QUEST_FINISH_4002", action = "action_EVENT_QUEST_FINISH_4002" },
-- 检查7050903完成
{ config_id = 1004003, name = "QUEST_FINISH_4003", event = EventType.EVENT_QUEST_FINISH, source = "", condition = "condition_EVENT_QUEST_FINISH_4003", action = "action_EVENT_QUEST_FINISH_4003" },
-- 检查7050804完成
{ config_id = 1004004, name = "QUEST_FINISH_4004", event = EventType.EVENT_QUEST_FINISH, source = "", condition = "condition_EVENT_QUEST_FINISH_4004", action = "action_EVENT_QUEST_FINISH_4004" },
-- variable为3则切suite
{ config_id = 1004005, name = "ENTER_REGION_4005", event = EventType.EVENT_ENTER_REGION, source = "", condition = "condition_EVENT_ENTER_REGION_4005", action = "action_EVENT_ENTER_REGION_4005" }
}
-- 变量
variables = {
{ config_id = 1, name = "questFinishCount", value = 0, no_refresh = true }
}
--================================================================
--
-- 初始化配置
--
--================================================================
-- 初始化时创建
init_config = {
suite = 1,
end_suite = 0,
rand_suite = false
}
--================================================================
--
-- 小组配置
--
--================================================================
suites = {
{
-- suite_id = 1,
-- description = Day3任务完成则切显示,
monsters = { },
gadgets = { },
regions = { },
triggers = { },
rand_weight = 100
},
{
-- suite_id = 2,
-- description = 显示,
monsters = { },
gadgets = { 4001 },
regions = { },
triggers = { },
rand_weight = 100
},
{
-- suite_id = 3,
-- description = ,
monsters = { },
gadgets = { },
regions = { 4005 },
triggers = { "QUEST_FINISH_4002", "QUEST_FINISH_4003", "QUEST_FINISH_4004", "ENTER_REGION_4005" },
rand_weight = 100
}
}
--================================================================
--
-- 触发器
--
--================================================================
-- 触发条件
function condition_EVENT_QUEST_FINISH_4002(context, evt)
--检查ID为7050303的任务的完成状态是否为1(1=完成,0=失败)
--此事件需要配合Quest表使用,在Quest表里的完成执行中配置“通知group脚本”,则该任务完成后服务端会向对应的group发送通知,参数1填写场景ID,参数2填写group ID(如果不填则会通知所有group)
--检查任务ID
if 7050303 ~= evt.param1 then
return false
end
--检查任务成功状态
if 1 ~= evt.param2 then
return false
end
return true
end
-- 触发操作
function action_EVENT_QUEST_FINISH_4002(context, evt)
-- 针对当前group内变量名为 "questFinishCount" 的变量,进行修改,变化值为 1
if 0 ~= ScriptLib.ChangeGroupVariableValue(context, "questFinishCount", 1) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : change_GroupVariable")
return -1
end
return 0
end
-- 触发条件
function condition_EVENT_QUEST_FINISH_4003(context, evt)
--检查ID为7050903的任务的完成状态是否为1(1=完成,0=失败)
--此事件需要配合Quest表使用,在Quest表里的完成执行中配置“通知group脚本”,则该任务完成后服务端会向对应的group发送通知,参数1填写场景ID,参数2填写group ID(如果不填则会通知所有group)
--检查任务ID
if 7050903 ~= evt.param1 then
return false
end
--检查任务成功状态
if 1 ~= evt.param2 then
return false
end
return true
end
-- 触发操作
function action_EVENT_QUEST_FINISH_4003(context, evt)
-- 针对当前group内变量名为 "questFinishCount" 的变量,进行修改,变化值为 1
if 0 ~= ScriptLib.ChangeGroupVariableValue(context, "questFinishCount", 1) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : change_GroupVariable")
return -1
end
return 0
end
-- 触发条件
function condition_EVENT_QUEST_FINISH_4004(context, evt)
--检查ID为7050804的任务的完成状态是否为1(1=完成,0=失败)
--此事件需要配合Quest表使用,在Quest表里的完成执行中配置“通知group脚本”,则该任务完成后服务端会向对应的group发送通知,参数1填写场景ID,参数2填写group ID(如果不填则会通知所有group)
--检查任务ID
if 7050804 ~= evt.param1 then
return false
end
--检查任务成功状态
if 1 ~= evt.param2 then
return false
end
return true
end
-- 触发操作
function action_EVENT_QUEST_FINISH_4004(context, evt)
-- 针对当前group内变量名为 "questFinishCount" 的变量,进行修改,变化值为 1
if 0 ~= ScriptLib.ChangeGroupVariableValue(context, "questFinishCount", 1) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : change_GroupVariable")
return -1
end
return 0
end
-- 触发条件
function condition_EVENT_ENTER_REGION_4005(context, evt)
if evt.param1 ~= 4005 then return false end
-- 判断变量"questFinishCount"为3
if ScriptLib.GetGroupVariableValue(context, "questFinishCount") ~= 3 then
return false
end
return true
end
-- 触发操作
function action_EVENT_ENTER_REGION_4005(context, evt)
-- 重新生成指定group,指定suite
if 0 ~= ScriptLib.RefreshGroup(context, { group_id = 201068004, suite = 2 }) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : refresh_group_to_suite")
return -1
end
return 0
end