149 lines
4.0 KiB
Go
149 lines
4.0 KiB
Go
-- 基础信息
|
||
local base_info = {
|
||
group_id = 240604009
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 配置
|
||
--
|
||
--================================================================
|
||
|
||
-- 怪物
|
||
monsters = {
|
||
}
|
||
|
||
-- NPC
|
||
npcs = {
|
||
}
|
||
|
||
-- 装置
|
||
gadgets = {
|
||
{ config_id = 9001, gadget_id = 70360010, pos = { x = 0.000, y = -0.051, z = 8.000 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 }
|
||
}
|
||
|
||
-- 区域
|
||
regions = {
|
||
}
|
||
|
||
-- 触发器
|
||
triggers = {
|
||
{ config_id = 1009002, name = "GADGET_CREATE_9002", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_9002", action = "action_EVENT_GADGET_CREATE_9002" },
|
||
{ config_id = 1009003, name = "SELECT_OPTION_9003", event = EventType.EVENT_SELECT_OPTION, source = "", condition = "condition_EVENT_SELECT_OPTION_9003", action = "action_EVENT_SELECT_OPTION_9003", trigger_count = 0 }
|
||
}
|
||
|
||
-- 变量
|
||
variables = {
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 初始化配置
|
||
--
|
||
--================================================================
|
||
|
||
-- 初始化时创建
|
||
init_config = {
|
||
suite = 1,
|
||
end_suite = 0,
|
||
rand_suite = false
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 小组配置
|
||
--
|
||
--================================================================
|
||
|
||
suites = {
|
||
{
|
||
-- suite_id = 1,
|
||
-- description = ,
|
||
monsters = { },
|
||
gadgets = { 9001 },
|
||
regions = { },
|
||
triggers = { "GADGET_CREATE_9002", "SELECT_OPTION_9003" },
|
||
rand_weight = 100
|
||
}
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 触发器
|
||
--
|
||
--================================================================
|
||
|
||
-- 触发条件
|
||
function condition_EVENT_GADGET_CREATE_9002(context, evt)
|
||
if 9001 ~= evt.param1 then
|
||
return false
|
||
end
|
||
|
||
return true
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_GADGET_CREATE_9002(context, evt)
|
||
-- 设置操作台选项
|
||
if 0 ~= ScriptLib.SetWorktopOptionsByGroupId(context, 240604009, 9001, {7}) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_wok_options_by_configid")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end
|
||
|
||
-- 触发条件
|
||
function condition_EVENT_SELECT_OPTION_9003(context, evt)
|
||
-- 判断是gadgetid 9001 option_id 7
|
||
if 9001 ~= evt.param1 then
|
||
return false
|
||
end
|
||
|
||
if 7 ~= evt.param2 then
|
||
return false
|
||
end
|
||
|
||
|
||
return true
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_SELECT_OPTION_9003(context, evt)
|
||
-- 创建编号为1(该怪物潮的识别id)的怪物潮,创建怪物总数为1,场上怪物最少1只,最多1只
|
||
if 0 ~= ScriptLib.AutoMonsterTide(context, 1, 240604010, {10002}, 1, 1, 1) then
|
||
return -1
|
||
end
|
||
|
||
-- 删除指定group: 240604009 ;指定config:9001;物件身上指定option:7;
|
||
if 0 ~= ScriptLib.DelWorktopOptionByGroupId(context, 240604009, 9001, 7) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : del_work_options_by_group_configId")
|
||
return -1
|
||
end
|
||
|
||
-- 改变指定group组240604009中, configid为9001的gadget的state
|
||
if 0 ~= ScriptLib.SetGroupGadgetStateByConfigId(context, 240604009, 9001, GadgetState.GearStop) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_GroupId_ConfigId")
|
||
return -1
|
||
end
|
||
|
||
-- 改变指定group组240604008中, configid为8002的gadget的state
|
||
if 0 ~= ScriptLib.SetGroupGadgetStateByConfigId(context, 240604008, 8002, GadgetState.Default) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_GroupId_ConfigId")
|
||
return -1
|
||
end
|
||
|
||
-- 改变指定group组240604008中, configid为8001的gadget的state
|
||
if 0 ~= ScriptLib.SetGroupGadgetStateByConfigId(context, 240604008, 8001, GadgetState.Default) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_GroupId_ConfigId")
|
||
return -1
|
||
end
|
||
|
||
-- 改变指定group组240604008中, configid为8003的gadget的state
|
||
if 0 ~= ScriptLib.SetGroupGadgetStateByConfigId(context, 240604008, 8003, GadgetState.GearStart) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_GroupId_ConfigId")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end |