308 lines
9.9 KiB
Go
308 lines
9.9 KiB
Go
-- 基础信息
|
||
local base_info = {
|
||
group_id = 240018001
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 配置
|
||
--
|
||
--================================================================
|
||
|
||
-- 怪物
|
||
monsters = {
|
||
}
|
||
|
||
-- NPC
|
||
npcs = {
|
||
}
|
||
|
||
-- 装置
|
||
gadgets = {
|
||
{ config_id = 1001, gadget_id = 70350023, pos = { x = -87.026, y = 117.594, z = 108.916 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 },
|
||
{ config_id = 1002, gadget_id = 70350023, pos = { x = -101.039, y = 111.826, z = 33.953 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 },
|
||
{ config_id = 1003, gadget_id = 70350023, pos = { x = -18.366, y = 111.691, z = 68.155 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 }
|
||
}
|
||
|
||
-- 区域
|
||
regions = {
|
||
}
|
||
|
||
-- 触发器
|
||
triggers = {
|
||
{ config_id = 1001004, name = "GADGET_CREATE_1004", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_1004", action = "action_EVENT_GADGET_CREATE_1004" },
|
||
{ config_id = 1001005, name = "GADGET_CREATE_1005", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_1005", action = "action_EVENT_GADGET_CREATE_1005" },
|
||
{ config_id = 1001006, name = "GADGET_CREATE_1006", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_1006", action = "action_EVENT_GADGET_CREATE_1006" },
|
||
{ config_id = 1001007, name = "SELECT_OPTION_1007", event = EventType.EVENT_SELECT_OPTION, source = "", condition = "condition_EVENT_SELECT_OPTION_1007", action = "action_EVENT_SELECT_OPTION_1007" },
|
||
{ config_id = 1001016, name = "SELECT_OPTION_1016", event = EventType.EVENT_SELECT_OPTION, source = "", condition = "condition_EVENT_SELECT_OPTION_1016", action = "action_EVENT_SELECT_OPTION_1016" },
|
||
{ config_id = 1001017, name = "SELECT_OPTION_1017", event = EventType.EVENT_SELECT_OPTION, source = "", condition = "condition_EVENT_SELECT_OPTION_1017", action = "action_EVENT_SELECT_OPTION_1017" }
|
||
}
|
||
|
||
-- 变量
|
||
variables = {
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 初始化配置
|
||
--
|
||
--================================================================
|
||
|
||
-- 初始化时创建
|
||
init_config = {
|
||
suite = 1,
|
||
end_suite = 0,
|
||
rand_suite = false
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 小组配置
|
||
--
|
||
--================================================================
|
||
|
||
suites = {
|
||
{
|
||
-- suite_id = 1,
|
||
-- description = ,
|
||
monsters = { },
|
||
gadgets = { 1001, 1002, 1003 },
|
||
regions = { },
|
||
triggers = { "GADGET_CREATE_1004", "GADGET_CREATE_1005", "GADGET_CREATE_1006", "SELECT_OPTION_1007", "SELECT_OPTION_1016", "SELECT_OPTION_1017" },
|
||
rand_weight = 100
|
||
}
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 触发器
|
||
--
|
||
--================================================================
|
||
|
||
-- 触发条件
|
||
function condition_EVENT_GADGET_CREATE_1004(context, evt)
|
||
if 1001 ~= evt.param1 then
|
||
return false
|
||
end
|
||
|
||
return true
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_GADGET_CREATE_1004(context, evt)
|
||
-- 设置操作台选项
|
||
if 0 ~= ScriptLib.SetWorktopOptionsByGroupId(context, 240018001, 1001, {177}) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_wok_options_by_configid")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end
|
||
|
||
-- 触发条件
|
||
function condition_EVENT_GADGET_CREATE_1005(context, evt)
|
||
if 1002 ~= evt.param1 then
|
||
return false
|
||
end
|
||
|
||
return true
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_GADGET_CREATE_1005(context, evt)
|
||
-- 设置操作台选项
|
||
if 0 ~= ScriptLib.SetWorktopOptionsByGroupId(context, 240018001, 1002, {177}) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_wok_options_by_configid")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end
|
||
|
||
-- 触发条件
|
||
function condition_EVENT_GADGET_CREATE_1006(context, evt)
|
||
if 1003 ~= evt.param1 then
|
||
return false
|
||
end
|
||
|
||
return true
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_GADGET_CREATE_1006(context, evt)
|
||
-- 设置操作台选项
|
||
if 0 ~= ScriptLib.SetWorktopOptionsByGroupId(context, 240018001, 1003, {177}) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_wok_options_by_configid")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end
|
||
|
||
-- 触发条件
|
||
function condition_EVENT_SELECT_OPTION_1007(context, evt)
|
||
-- 判断是gadgetid 1001 option_id 177
|
||
if 1001 ~= evt.param1 then
|
||
return false
|
||
end
|
||
|
||
if 177 ~= evt.param2 then
|
||
return false
|
||
end
|
||
|
||
|
||
return true
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_SELECT_OPTION_1007(context, evt)
|
||
-- 删除指定group: 240018001 ;指定config:1001;物件身上指定option:177;
|
||
if 0 ~= ScriptLib.DelWorktopOptionByGroupId(context, 240018001, 1001, 177) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : del_work_options_by_group_configId")
|
||
return -1
|
||
end
|
||
|
||
-- 删除指定group: 240018001 ;指定config:1002;物件身上指定option:177;
|
||
if 0 ~= ScriptLib.DelWorktopOptionByGroupId(context, 240018001, 1002, 177) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : del_work_options_by_group_configId")
|
||
return -1
|
||
end
|
||
|
||
-- 删除指定group: 240018001 ;指定config:1003;物件身上指定option:177;
|
||
if 0 ~= ScriptLib.DelWorktopOptionByGroupId(context, 240018001, 1003, 177) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : del_work_options_by_group_configId")
|
||
return -1
|
||
end
|
||
|
||
-- 将configid为 1001 的物件更改为状态 GadgetState.GearAction1
|
||
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 1001, GadgetState.GearAction1) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
|
||
return -1
|
||
end
|
||
|
||
-- 将configid为 1002 的物件更改为状态 GadgetState.GearAction1
|
||
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 1002, GadgetState.GearAction1) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
|
||
return -1
|
||
end
|
||
|
||
-- 将configid为 1003 的物件更改为状态 GadgetState.GearAction1
|
||
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 1003, GadgetState.GearAction1) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end
|
||
|
||
-- 触发条件
|
||
function condition_EVENT_SELECT_OPTION_1016(context, evt)
|
||
-- 判断是gadgetid 1002 option_id 177
|
||
if 1002 ~= evt.param1 then
|
||
return false
|
||
end
|
||
|
||
if 177 ~= evt.param2 then
|
||
return false
|
||
end
|
||
|
||
|
||
return true
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_SELECT_OPTION_1016(context, evt)
|
||
-- 删除指定group: 240018001 ;指定config:1001;物件身上指定option:177;
|
||
if 0 ~= ScriptLib.DelWorktopOptionByGroupId(context, 240018001, 1001, 177) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : del_work_options_by_group_configId")
|
||
return -1
|
||
end
|
||
|
||
-- 删除指定group: 240018001 ;指定config:1002;物件身上指定option:177;
|
||
if 0 ~= ScriptLib.DelWorktopOptionByGroupId(context, 240018001, 1002, 177) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : del_work_options_by_group_configId")
|
||
return -1
|
||
end
|
||
|
||
-- 删除指定group: 240018001 ;指定config:1003;物件身上指定option:177;
|
||
if 0 ~= ScriptLib.DelWorktopOptionByGroupId(context, 240018001, 1003, 177) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : del_work_options_by_group_configId")
|
||
return -1
|
||
end
|
||
|
||
-- 将configid为 1001 的物件更改为状态 GadgetState.GearAction1
|
||
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 1001, GadgetState.GearAction1) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
|
||
return -1
|
||
end
|
||
|
||
-- 将configid为 1002 的物件更改为状态 GadgetState.GearAction1
|
||
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 1002, GadgetState.GearAction1) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
|
||
return -1
|
||
end
|
||
|
||
-- 将configid为 1003 的物件更改为状态 GadgetState.GearAction1
|
||
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 1003, GadgetState.GearAction1) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end
|
||
|
||
-- 触发条件
|
||
function condition_EVENT_SELECT_OPTION_1017(context, evt)
|
||
-- 判断是gadgetid 1003 option_id 177
|
||
if 1003 ~= evt.param1 then
|
||
return false
|
||
end
|
||
|
||
if 177 ~= evt.param2 then
|
||
return false
|
||
end
|
||
|
||
|
||
return true
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_SELECT_OPTION_1017(context, evt)
|
||
-- 删除指定group: 240018001 ;指定config:1001;物件身上指定option:177;
|
||
if 0 ~= ScriptLib.DelWorktopOptionByGroupId(context, 240018001, 1001, 177) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : del_work_options_by_group_configId")
|
||
return -1
|
||
end
|
||
|
||
-- 删除指定group: 240018001 ;指定config:1002;物件身上指定option:177;
|
||
if 0 ~= ScriptLib.DelWorktopOptionByGroupId(context, 240018001, 1002, 177) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : del_work_options_by_group_configId")
|
||
return -1
|
||
end
|
||
|
||
-- 删除指定group: 240018001 ;指定config:1003;物件身上指定option:177;
|
||
if 0 ~= ScriptLib.DelWorktopOptionByGroupId(context, 240018001, 1003, 177) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : del_work_options_by_group_configId")
|
||
return -1
|
||
end
|
||
|
||
-- 将configid为 1001 的物件更改为状态 GadgetState.GearAction1
|
||
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 1001, GadgetState.GearAction1) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
|
||
return -1
|
||
end
|
||
|
||
-- 将configid为 1002 的物件更改为状态 GadgetState.GearAction1
|
||
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 1002, GadgetState.GearAction1) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
|
||
return -1
|
||
end
|
||
|
||
-- 将configid为 1003 的物件更改为状态 GadgetState.GearAction1
|
||
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 1003, GadgetState.GearAction1) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end |