344 lines
12 KiB
Go
344 lines
12 KiB
Go
-- 基础信息
|
||
local base_info = {
|
||
group_id = 177006064
|
||
}
|
||
|
||
-- Trigger变量
|
||
local defs = {
|
||
duration = 120,
|
||
kill_sum = 3,
|
||
group_id = 177006064,
|
||
gadget_controller_id = 64002
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 配置
|
||
--
|
||
--================================================================
|
||
|
||
-- 怪物
|
||
monsters = {
|
||
{ config_id = 64001, monster_id = 26050901, pos = { x = 440.056, y = 141.230, z = -195.366 }, rot = { x = 0.000, y = 10.393, z = 0.000 }, level = 36, drop_id = 1000100, affix = { 1032, 5135 }, area_id = 210 },
|
||
{ config_id = 64011, monster_id = 26051001, pos = { x = 453.436, y = 141.230, z = -185.068 }, rot = { x = 0.000, y = 241.872, z = 0.000 }, level = 36, drop_id = 1000100, affix = { 1032, 5135 }, area_id = 210 },
|
||
{ config_id = 64012, monster_id = 26051101, pos = { x = 438.747, y = 141.230, z = -177.739 }, rot = { x = 0.000, y = 145.359, z = 0.000 }, level = 36, drop_id = 1000100, affix = { 1032, 5135 }, area_id = 210 }
|
||
}
|
||
|
||
-- NPC
|
||
npcs = {
|
||
}
|
||
|
||
-- 装置
|
||
gadgets = {
|
||
{ config_id = 64002, gadget_id = 70330138, pos = { x = 445.761, y = 141.653, z = -191.235 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, state = GadgetState.GearAction2, persistent = true, area_id = 210 },
|
||
{ config_id = 64003, gadget_id = 70211163, pos = { x = 440.026, y = 141.380, z = -183.441 }, rot = { x = 0.004, y = 0.166, z = 356.352 }, level = 16, drop_tag = "渊下宫活动超级稻妻", isOneoff = true, persistent = true, area_id = 210 },
|
||
{ config_id = 64010, gadget_id = 70800109, pos = { x = 443.122, y = 141.713, z = -188.003 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 36, area_id = 210 }
|
||
}
|
||
|
||
-- 区域
|
||
regions = {
|
||
}
|
||
|
||
-- 触发器
|
||
triggers = {
|
||
-- 2.0rel加的保底,如果group在挑战中间被卸载了,需要在加载时加个保底置回初始状态
|
||
{ config_id = 1064005, name = "GROUP_LOAD_64005", event = EventType.EVENT_GROUP_LOAD, source = "", condition = "condition_EVENT_GROUP_LOAD_64005", action = "action_EVENT_GROUP_LOAD_64005", trigger_count = 0 },
|
||
{ config_id = 1064006, name = "CHALLENGE_SUCCESS_64006", event = EventType.EVENT_CHALLENGE_SUCCESS, source = "180", condition = "", action = "action_EVENT_CHALLENGE_SUCCESS_64006", trigger_count = 0 },
|
||
{ config_id = 1064007, name = "CHALLENGE_FAIL_64007", event = EventType.EVENT_CHALLENGE_FAIL, source = "180", condition = "", action = "action_EVENT_CHALLENGE_FAIL_64007", trigger_count = 0 },
|
||
{ config_id = 1064009, name = "SELECT_OPTION_64009", event = EventType.EVENT_SELECT_OPTION, source = "", condition = "condition_EVENT_SELECT_OPTION_64009", action = "action_EVENT_SELECT_OPTION_64009", trigger_count = 0 },
|
||
{ config_id = 1064013, name = "VARIABLE_CHANGE_64013", event = EventType.EVENT_VARIABLE_CHANGE, source = "", condition = "condition_EVENT_VARIABLE_CHANGE_64013", action = "action_EVENT_VARIABLE_CHANGE_64013" },
|
||
{ config_id = 1064014, name = "GADGET_CREATE_64014", event = EventType.EVENT_GADGET_CREATE, source = "", condition = "condition_EVENT_GADGET_CREATE_64014", action = "action_EVENT_GADGET_CREATE_64014", trigger_count = 0 },
|
||
{ config_id = 1064015, name = "GADGET_STATE_CHANGE_64015", event = EventType.EVENT_GADGET_STATE_CHANGE, source = "", condition = "condition_EVENT_GADGET_STATE_CHANGE_64015", action = "action_EVENT_GADGET_STATE_CHANGE_64015", trigger_count = 0 }
|
||
}
|
||
|
||
-- 变量
|
||
variables = {
|
||
{ config_id = 1, name = "isFinish", value = 0, no_refresh = true },
|
||
{ config_id = 2, name = "flag", value = 0, no_refresh = true }
|
||
}
|
||
|
||
-- 废弃数据
|
||
garbages = {
|
||
gadgets = {
|
||
{ config_id = 64004, gadget_id = 70360001, pos = { x = 445.750, y = 142.782, z = -191.251 }, rot = { x = 0.000, y = 0.000, z = 0.000 }, level = 1, state = GadgetState.GearAction2, area_id = 210 }
|
||
},
|
||
triggers = {
|
||
{ config_id = 1064008, name = "GADGET_STATE_CHANGE_64008", event = EventType.EVENT_GADGET_STATE_CHANGE, source = "", condition = "condition_EVENT_GADGET_STATE_CHANGE_64008", action = "action_EVENT_GADGET_STATE_CHANGE_64008", trigger_count = 0 }
|
||
}
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 初始化配置
|
||
--
|
||
--================================================================
|
||
|
||
-- 初始化时创建
|
||
init_config = {
|
||
suite = 1,
|
||
end_suite = 0,
|
||
rand_suite = false
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 小组配置
|
||
--
|
||
--================================================================
|
||
|
||
suites = {
|
||
{
|
||
-- suite_id = 1,
|
||
-- description = suite_1,
|
||
monsters = { },
|
||
gadgets = { 64002, 64010 },
|
||
regions = { },
|
||
triggers = { "GROUP_LOAD_64005", "CHALLENGE_SUCCESS_64006", "CHALLENGE_FAIL_64007", "SELECT_OPTION_64009", "VARIABLE_CHANGE_64013", "GADGET_CREATE_64014", "GADGET_STATE_CHANGE_64015" },
|
||
rand_weight = 100
|
||
},
|
||
{
|
||
-- suite_id = 2,
|
||
-- description = suite_2,
|
||
monsters = { 64001, 64011, 64012 },
|
||
gadgets = { },
|
||
regions = { },
|
||
triggers = { },
|
||
rand_weight = 100
|
||
},
|
||
{
|
||
-- suite_id = 3,
|
||
-- description = ,
|
||
monsters = { },
|
||
gadgets = { },
|
||
regions = { },
|
||
triggers = { },
|
||
rand_weight = 100
|
||
}
|
||
}
|
||
|
||
--================================================================
|
||
--
|
||
-- 触发器
|
||
--
|
||
--================================================================
|
||
|
||
-- 触发条件
|
||
function condition_EVENT_GROUP_LOAD_64005(context, evt)
|
||
-- 判断变量"isFinish"为1
|
||
if ScriptLib.GetGroupVariableValue(context, "isFinish") ~= 1 then
|
||
return false
|
||
end
|
||
|
||
return true
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_GROUP_LOAD_64005(context, evt)
|
||
-- 将configid为 64002 的物件更改为状态 GadgetState.Default
|
||
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 64002, GadgetState.Default) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
|
||
return -1
|
||
end
|
||
|
||
-- 删除suite2的所有内容
|
||
ScriptLib.RemoveExtraGroupSuite(context, 177006064, 2)
|
||
|
||
-- 运营数据埋点,匹配LD定义的规则使用
|
||
if 0 ~= ScriptLib.MarkPlayerAction(context, 3001, 4, 1) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : mark_playerAction")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_CHALLENGE_SUCCESS_64006(context, evt)
|
||
-- 将本组内变量名为 "isFinish" 的变量设置为 2
|
||
if 0 ~= ScriptLib.SetGroupVariableValue(context, "isFinish", 2) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_groupVariable")
|
||
return -1
|
||
end
|
||
|
||
-- 将configid为 64002 的物件更改为状态 GadgetState.GearStop
|
||
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 64002, GadgetState.GearStop) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
|
||
return -1
|
||
end
|
||
|
||
-- 将本组内变量名为 "flag" 的变量设置为 1
|
||
if 0 ~= ScriptLib.SetGroupVariableValueByGroup(context, "flag", 1, 177006083) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_groupVariable_by_group")
|
||
return -1
|
||
end
|
||
|
||
-- 添加suite2的新内容
|
||
ScriptLib.AddExtraGroupSuite(context, 177006083, 2)
|
||
|
||
-- 触发镜头注目,注目位置为坐标{x=442.049, y=142.7725, z=-184.7132},持续时间为1.5秒,并且为强制注目形式,不广播其他玩家
|
||
local pos = {x=442.049, y=142.7725, z=-184.7132}
|
||
local pos_follow = {x=0, y=0, z=0}
|
||
if 0 ~= ScriptLib.BeginCameraSceneLook(context, { look_pos = pos, is_allow_input = false, duration = 1.5, is_force = true, is_broadcast = false, is_recover_keep_current = true, delay = 0,
|
||
is_set_follow_pos = false, follow_pos = pos_follow, is_force_walk = false, is_change_play_mode = false,
|
||
is_set_screen_XY = false, screen_x = 0, screen_y = 0 }) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : active_cameraLook_Begin")
|
||
return -1
|
||
end
|
||
|
||
-- 运营数据埋点,匹配LD定义的规则使用
|
||
if 0 ~= ScriptLib.MarkPlayerAction(context, 3001, 3, 1) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : mark_playerAction")
|
||
return -1
|
||
end
|
||
|
||
-- 创建id为64003的gadget
|
||
if 0 ~= ScriptLib.CreateGadget(context, { config_id = 64003 }) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : create_gadget")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_CHALLENGE_FAIL_64007(context, evt)
|
||
-- 将configid为 64002 的物件更改为状态 GadgetState.Default
|
||
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 64002, GadgetState.Default) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_gadget_state_by_configId")
|
||
return -1
|
||
end
|
||
|
||
-- 删除suite2的所有内容
|
||
ScriptLib.RemoveExtraGroupSuite(context, 177006064, 2)
|
||
|
||
-- 运营数据埋点,匹配LD定义的规则使用
|
||
if 0 ~= ScriptLib.MarkPlayerAction(context, 3001, 4, 1) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : mark_playerAction")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end
|
||
|
||
-- 触发条件
|
||
function condition_EVENT_SELECT_OPTION_64009(context, evt)
|
||
-- 判断是gadgetid 64002 option_id 177
|
||
if 64002 ~= evt.param1 then
|
||
return false
|
||
end
|
||
|
||
if 177 ~= evt.param2 then
|
||
return false
|
||
end
|
||
|
||
|
||
return true
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_SELECT_OPTION_64009(context, evt)
|
||
-- 180号挑战,duration内击杀kill_sum的怪物
|
||
if 0 ~= ScriptLib.ActiveChallenge(context, 180, 180, defs.duration, defs.group_id, defs.kill_sum, 0) then
|
||
return -1
|
||
end
|
||
|
||
-- 添加suite2的新内容
|
||
ScriptLib.AddExtraGroupSuite(context, defs.group_id, 2)
|
||
|
||
|
||
if 0 ~= ScriptLib.DelWorktopOptionByGroupId(context, defs.group_id, defs.gadget_controller_id, 177) then
|
||
return -1
|
||
end
|
||
|
||
|
||
-- 将configid为 2002 的物件更改为状态 GadgetState.GearStart
|
||
if 0 ~= ScriptLib.SetGadgetStateByConfigId(context, 64002, GadgetState.GearStart) then
|
||
return -1
|
||
end
|
||
|
||
|
||
|
||
-- 运营数据埋点,匹配LD定义的规则使用
|
||
if 0 ~= ScriptLib.MarkPlayerAction(context, 3001, 1, 1) then
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
|
||
end
|
||
|
||
-- 触发条件
|
||
function condition_EVENT_VARIABLE_CHANGE_64013(context, evt)
|
||
if evt.param1 == evt.param2 then return false end
|
||
|
||
-- 判断变量"flag"为3
|
||
if ScriptLib.GetGroupVariableValue(context, "flag") ~= 3 then
|
||
return false
|
||
end
|
||
|
||
return true
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_VARIABLE_CHANGE_64013(context, evt)
|
||
-- 永久关闭CongfigId的Gadget,需要和Groups的RefreshWithBlock标签搭配
|
||
if 0 ~= ScriptLib.KillEntityByConfigId(context, { config_id = 64010 }) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : kill_entity_by_configId")
|
||
return -1
|
||
end
|
||
|
||
|
||
return 0
|
||
end
|
||
|
||
-- 触发条件
|
||
function condition_EVENT_GADGET_CREATE_64014(context, evt)
|
||
if 64002 ~= evt.param1 or GadgetState.Default ~= ScriptLib.GetGadgetStateByConfigId(context, 0, evt.param1) then
|
||
return false
|
||
end
|
||
|
||
return true
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_GADGET_CREATE_64014(context, evt)
|
||
-- 设置操作台选项
|
||
if 0 ~= ScriptLib.SetWorktopOptions(context, {177}) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_work_options")
|
||
return -1
|
||
end
|
||
|
||
-- 将本组内变量名为 "isFinish" 的变量设置为 1
|
||
if 0 ~= ScriptLib.SetGroupVariableValue(context, "isFinish", 1) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_groupVariable")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end
|
||
|
||
-- 触发条件
|
||
function condition_EVENT_GADGET_STATE_CHANGE_64015(context, evt)
|
||
if 64002 ~= evt.param2 or GadgetState.Default ~= evt.param1 then
|
||
return false
|
||
end
|
||
|
||
return true
|
||
end
|
||
|
||
-- 触发操作
|
||
function action_EVENT_GADGET_STATE_CHANGE_64015(context, evt)
|
||
-- 设置操作台选项
|
||
if 0 ~= ScriptLib.SetWorktopOptionsByGroupId(context, 177006064, 64002, {177}) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_wok_options_by_configid")
|
||
return -1
|
||
end
|
||
|
||
-- 将本组内变量名为 "isFinish" 的变量设置为 1
|
||
if 0 ~= ScriptLib.SetGroupVariableValue(context, "isFinish", 1) then
|
||
ScriptLib.PrintContextLog(context, "@@ LUA_WARNING : set_groupVariable")
|
||
return -1
|
||
end
|
||
|
||
return 0
|
||
end |