260 lines
7.3 KiB
Go
260 lines
7.3 KiB
Go
-- 基础信息
|
||
local base_info = {
|
||
group_id = 250041001
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 配置
|
||
--
|
||
--================================================================
|
||
|
||
-- 怪物
|
||
monsters = {
|
||
}
|
||
|
||
-- NPC
|
||
npcs = {
|
||
}
|
||
|
||
-- 装置
|
||
gadgets = {
|
||
-- 随机用
|
||
{ config_id = 1001, gadget_id = 70360002, pos = { x = -21.025, y = 35.550, z = -81.270 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 },
|
||
{ config_id = 1002, gadget_id = 70350139, pos = { x = -30.000, y = 35.550, z = -70.000 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 },
|
||
-- 重置用
|
||
{ config_id = 1009, gadget_id = 70360002, pos = { x = -24.448, y = 35.550, z = -83.159 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 },
|
||
{ config_id = 1012, gadget_id = 70350140, pos = { x = -29.999, y = 38.097, z = -69.985 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1 }
|
||
}
|
||
|
||
-- 区域
|
||
regions = {
|
||
}
|
||
|
||
-- 触发器
|
||
triggers = {
|
||
{ config_id = 1001003, name = "GADGET_CREATE_1003", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_1003", action = "action_EVENT_GADGET_CREATE_1003" },
|
||
{ config_id = 1001004, name = "SELECT_OPTION_1004", event = EventType.EVENT_SELECT_OPTION, source = "", condition = "condition_EVENT_SELECT_OPTION_1004", action = "action_EVENT_SELECT_OPTION_1004" },
|
||
{ config_id = 1001005, name = "CHALLENGE_FAIL_1005", event = EventType.EVENT_CHALLENGE_FAIL, source = "666", condition = "", action = "action_EVENT_CHALLENGE_FAIL_1005" },
|
||
{ config_id = 1001006, name = "TIMER_EVENT_1006", event = EventType.EVENT_TIMER_EVENT, source = "SS1", condition = "", action = "action_EVENT_TIMER_EVENT_1006", trigger_count = 50 },
|
||
{ config_id = 1001007, name = "TIMER_EVENT_1007", event = EventType.EVENT_TIMER_EVENT, source = "SS2", condition = "", action = "action_EVENT_TIMER_EVENT_1007", trigger_count = 50 },
|
||
{ config_id = 1001008, name = "SELECT_OPTION_1008", event = EventType.EVENT_SELECT_OPTION, source = "", condition = "condition_EVENT_SELECT_OPTION_1008", action = "action_EVENT_SELECT_OPTION_1008" },
|
||
{ config_id = 1001010, name = "GADGET_CREATE_1010", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_1010", action = "action_EVENT_GADGET_CREATE_1010" }
|
||
}
|
||
|
||
-- 变量
|
||
variables = {
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 初始化配置
|
||
--
|
||
--================================================================
|
||
|
||
-- 初始化时创建
|
||
init_config = {
|
||
suite = 1,
|
||
end_suite = 0,
|
||
rand_suite = false
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 小组配置
|
||
--
|
||
--================================================================
|
||
|
||
suites = {
|
||
{
|
||
-- suite_id = 1,
|
||
-- description = ,
|
||
monsters = { },
|
||
gadgets = { },
|
||
regions = { },
|
||
triggers = { },
|
||
rand_weight = 100,
|
||
ban_refresh = true
|
||
},
|
||
{
|
||
-- suite_id = 2,
|
||
-- description = ,
|
||
monsters = { },
|
||
gadgets = { 1001, 1002, 1009, 1012 },
|
||
regions = { },
|
||
triggers = { "GADGET_CREATE_1003", "SELECT_OPTION_1004", "CHALLENGE_FAIL_1005", "TIMER_EVENT_1006", "TIMER_EVENT_1007", "SELECT_OPTION_1008", "GADGET_CREATE_1010" },
|
||
rand_weight = 100,
|
||
ban_refresh = true
|
||
},
|
||
{
|
||
-- suite_id = 3,
|
||
-- description = ,
|
||
monsters = { },
|
||
gadgets = { },
|
||
regions = { },
|
||
triggers = { },
|
||
rand_weight = 100,
|
||
ban_refresh = true
|
||
}
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 触发器
|
||
--
|
||
--================================================================
|
||
|
||
-- 触发条件
|
||
function condition_EVENT_GADGET_CREATE_1003(context, evt)
|
||
if 1001 ~= evt.param1 then
|
||
return false
|
||
end
|
||
|
||
return true
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_GADGET_CREATE_1003(context, evt)
|
||
-- 设置操作台选项
|
||
if 0 ~= ScriptLib.SetWorktopOptions(context, {2}) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_work_options")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end
|
||
|
||
-- 触发条件
|
||
function condition_EVENT_SELECT_OPTION_1004(context, evt)
|
||
-- 判断是gadgetid 1001 option_id 2
|
||
if 1001 ~= evt.param1 then
|
||
return false
|
||
end
|
||
|
||
if 2 ~= evt.param2 then
|
||
return false
|
||
end
|
||
|
||
|
||
return true
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_SELECT_OPTION_1004(context, evt)
|
||
-- 创建编号为666(该挑战的识别id),挑战内容为127的区域挑战,具体参数填写方式,见DungeonChallengeData表中的注释,所有填写的值都必须是int类型
|
||
if 0 ~= ScriptLib.ActiveChallenge(context, 666, 127, 60, 4, 666, 1) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_challenge")
|
||
return -1
|
||
end
|
||
|
||
-- 延迟3秒后,向groupId为:250041001的对象,请求一次调用,并将string参数:"SS1" 传递过去
|
||
if 0 ~= ScriptLib.CreateGroupTimerEvent(context, 250041001, "SS1", 3) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_timerevent_by_group")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_CHALLENGE_FAIL_1005(context, evt)
|
||
-- 取消group中对应名称的TimerEvent
|
||
if 0 ~= ScriptLib.CancelGroupTimerEvent(context, 250041001, "SS1") then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : cancel_timerevent_by_group")
|
||
return -1
|
||
end
|
||
|
||
-- 取消group中对应名称的TimerEvent
|
||
if 0 ~= ScriptLib.CancelGroupTimerEvent(context, 250041001, "SS2") then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : cancel_timerevent_by_group")
|
||
return -1
|
||
end
|
||
|
||
-- 重新生成指定group,指定suite
|
||
if 0 ~= ScriptLib.RefreshGroup(context, { group_id = 250041001, suite = 1 }) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : refresh_group_to_suite")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_TIMER_EVENT_1006(context, evt)
|
||
if 0 ~= ScriptLib.CreateGroupTimerEvent(context, 250041001, "SS2", 8) then
|
||
return -1
|
||
end
|
||
|
||
|
||
|
||
return 0
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_TIMER_EVENT_1007(context, evt)
|
||
if 0 ~= ScriptLib.CreateGroupTimerEvent(context, 250041001, "SS1", 8) then
|
||
return -1
|
||
end
|
||
|
||
--ChangeBulletType(context)
|
||
|
||
return 0
|
||
end
|
||
|
||
-- 触发条件
|
||
function condition_EVENT_SELECT_OPTION_1008(context, evt)
|
||
-- 判断是gadgetid 1009 option_id 4
|
||
if 1009 ~= evt.param1 then
|
||
return false
|
||
end
|
||
|
||
if 4 ~= evt.param2 then
|
||
return false
|
||
end
|
||
|
||
|
||
return true
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_SELECT_OPTION_1008(context, evt)
|
||
-- 取消group中对应名称的TimerEvent
|
||
if 0 ~= ScriptLib.CancelGroupTimerEvent(context, 250041001, "SS1") then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : cancel_timerevent_by_group")
|
||
return -1
|
||
end
|
||
|
||
-- 取消group中对应名称的TimerEvent
|
||
if 0 ~= ScriptLib.CancelGroupTimerEvent(context, 250041001, "SS2") then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : cancel_timerevent_by_group")
|
||
return -1
|
||
end
|
||
|
||
-- 重新生成指定group,指定suite
|
||
if 0 ~= ScriptLib.RefreshGroup(context, { group_id = 250041001, suite = 1 }) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : refresh_group_to_suite")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end
|
||
|
||
-- 触发条件
|
||
function condition_EVENT_GADGET_CREATE_1010(context, evt)
|
||
if 1009 ~= evt.param1 then
|
||
return false
|
||
end
|
||
|
||
return true
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_GADGET_CREATE_1010(context, evt)
|
||
-- 设置操作台选项
|
||
if 0 ~= ScriptLib.SetWorktopOptionsByGroupId(context, 250041001, 1009, {4}) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_wok_options_by_configid")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end |