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

178 lines
4.9 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 = 220023005
}
--================================================================
--
-- 配置
--
--================================================================
-- 怪物
monsters = {
}
-- NPC
npcs = {
}
-- 装置
gadgets = {
{ config_id = 5001, gadget_id = 70350003, pos = { x = 159.145, y = 11.494, z = 23.801 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 },
{ config_id = 5002, gadget_id = 70350003, pos = { x = 178.086, y = 18.629, z = 4.084 }, rot = { x = 0.000, y = 90.000, z = 0.000 }, level = 1 },
{ config_id = 5003, gadget_id = 70360002, pos = { x = 161.987, y = 11.449, z = 26.479 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 }
}
-- 区域
regions = {
{ config_id = 7, shape = RegionShape.SPHERE, radius = 5, pos = { x = 159.084, y = 11.681, z = 21.788 } }
}
-- 触发器
triggers = {
{ config_id = 1000007, name = "ENTER_REGION_7", event = EventType.EVENT_ENTER_REGION, source = "", condition = "condition_EVENT_ENTER_REGION_7", action = "action_EVENT_ENTER_REGION_7", forbid_guest = false },
{ config_id = 1000021, name = "QUEST_FINISH_21", event = EventType.EVENT_QUEST_FINISH, source = "2010103", condition = "condition_EVENT_QUEST_FINISH_21", action = "action_EVENT_QUEST_FINISH_21", trigger_count = 0 },
{ config_id = 1000022, name = "SELECT_OPTION_22", event = EventType.EVENT_SELECT_OPTION, source = "", condition = "condition_EVENT_SELECT_OPTION_22", action = "action_EVENT_SELECT_OPTION_22", trigger_count = 0, forbid_guest = false }
}
-- 变量
variables = {
}
--================================================================
--
-- 初始化配置
--
--================================================================
-- 初始化时创建
init_config = {
suite = 1,
end_suite = 0,
rand_suite = false
}
--================================================================
--
-- 小组配置
--
--================================================================
suites = {
{
-- suite_id = 1,
-- description = ,
monsters = { },
gadgets = { 5001, 5002, 5003 },
regions = { 7 },
triggers = { "ENTER_REGION_7", "QUEST_FINISH_21", "SELECT_OPTION_22" },
rand_weight = 100
}
}
--================================================================
--
-- 触发器
--
--================================================================
-- 触发条件
function condition_EVENT_ENTER_REGION_7(context, evt)
if evt.param1 ~= 7 then return false end
-- 判断角色数量不少于1
if ScriptLib.GetRegionEntityCount(context, { region_eid = evt.source_eid, entity_type = EntityType.AVATAR }) < 1 then
return false
end
return true
end
-- 触发操作
function action_EVENT_ENTER_REGION_7(context, evt)
-- 将configid为 5002 的物件更改为状态 GadgetState.GearStart
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 5002, GadgetState.GearStart) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
return -1
end
return 0
end
-- 触发条件
function condition_EVENT_QUEST_FINISH_21(context, evt)
--检查ID为2010103的任务的完成状态是否为1(1=完成,0=失败)
--此事件需要配合Quest表使用,在Quest表里的完成执行中配置“通知group脚本”,则该任务完成后服务端会向对应的group发送通知,参数1填写场景ID,参数2填写group ID(如果不填则会通知所有group)
--检查任务ID
if 2010103 ~= evt.param1 then
return false
end
--检查任务成功状态
if 1 ~= evt.param2 then
return false
end
return true
end
-- 触发操作
function action_EVENT_QUEST_FINISH_21(context, evt)
-- 设置操作台选项
if 0 ~= ScriptLib.SetWorktopOptionsByGroupId(context, 220023005, 5003, {1003}) then
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_wok_options_by_configid")
return -1
end
return 0
end
-- 触发条件
function condition_EVENT_SELECT_OPTION_22(context, evt)
if 5003 ~= evt.param1 then
return false
end
return true
end
-- 触发操作
function action_EVENT_SELECT_OPTION_22(context, evt)
-- 根据不同的选项做不同的操作
if 1003 == evt.param2 then
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 5001, GadgetState.GearStart) then
return -1
end
end
-- 根据不同的选项做不同的操作
if 1003 == evt.param2 then
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 5002, GadgetState.GearStart) then
return -1
end
end
-- 通知任务系统完成条件类型"LUA通知",复杂参数为quest_param的进度+1
if 0 ~= ScriptLib.AddQuestProgress(context, "220023005") then
return -1
end
-- 根据不同的选项做不同的操作
if 1003 == evt.param2 then
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 5003, GadgetState.GearStart) then
return -1
end
end
-- 删除指定group: 220023012 ;指定config:36;物件身上指定option:1002;
if 0 ~= ScriptLib.DelWorktopOptionByGroupId(context, 220023005, 5003, 1003) then
return -1
end
return 0
end